Emulation devices, systems, and methods

ABSTRACT

An electronic device having addressable storage elements and a bus so that the storage elements are accessible via the bus, an address register connected to the bus, a data register connected to the bus, terminals for serial scan-in and scan-out, a scanable emulation control register coupled to the terminals, and a selecting circuit responsive to bits in the emulation control register for coupling the address register and the data register to the terminals to enable scanning of the address and data registers.

This application is a Continuation, of application Ser. No. 08/472,157filed on Jun. 7, 1995 of Gary L. Swoboda, et al, abandoned for EmulationDevices, Systems, and Methods, which is a continuation under 37 CFR 1.60of application Ser. No. 07/979,396, filed on Nov. 19, 1992 and nowabandoned which is a continuation under 37 CFR 1.62 of application Ser.No. 07/388,275, filed on Jul. 31, 1989, and now abandoned.

(C) Copyright 1989 Texas Instruments Incorporated. A portion of thedisclosure of this patent document contains material which is subject tocopyright protection. The copyright owner has no objection to thefacsimile reproduction by anyone of the patent disclosure, as it appearsin the Patent and Trademark Office patent file or records, but otherwisereserves all copyright rights whatsoever.

CROSS-REFERENCE TO RELATED APPLICATIONS

The related coassigned patent documents listed below are herebyincorporated herein by reference.

    ______________________________________                                        CROSS REFERENCE TABLE                                                         Docket    PTO Reference Effective Filing Date                                 ______________________________________                                        TI-12033  Pat. No. 4 860 290                                                                          06/02/1987                                            TI-12451  Pat. No. 5 109 494                                                                          12/31/1987                                            TI-12543  Pat. No. 5 101 498                                                                          12/31/1987                                            TI-14083  Ser. No. 08/001 915                                                                         05/04/1989                                            TI-14147  Ser. No. 07/918 902                                                                         05/04/1989                                            TI-14079  Pat. No. 5 586 215                                                                          05/04/1989                                            TI-14080  Pat. No. 5 072 418                                                                          05/04/1989                                            TI-14081  Pat. No. 5 142 677                                                                          05/04/1989                                            TI-14082  Pat. No. 5 155 812                                                                          05/04/1989                                            TI-14145  Ser. No. 08/293 259                                                                         05/04/1989                                            TI-14141  Ser. No. 07/846 459                                                                         07/31/1989                                            TI-14142  Ser. No. 07/832 661                                                                         07/31/1989                                            TI-14143  Ser. No. 07/827 549                                                                         07/31/1989                                            TI-14282  Ser. No. 07/949 757                                                                         07/31/1989                                            TI-14146  Pat. No. 5 329 471                                                                          07/31/1989                                            TI-12016  Pat. No. 5 495 487                                                                          09/07/1988                                            TI-13371  Ser. No. 08/542,236                                                                         09/07/1988                                            TI-13363  Pat. No. 5 084 874                                                                          09/07/1988                                            TI-12015  Pat. No. 4 872 169                                                                          03/06/1987                                            TI-12698  Ser. No. 07/440 454*                                                                        09/04/1987                                            TI-14312  Pat. No. 5 237 672                                                                          07/28/1989                                            TI-14315  Ser. No. 07/387 569*                                                                        07/28/1989                                            TI-14316  Ser. No. 07/387 455*                                                                        07/28/1989                                            TI-14320  Ser. No. 07/386 850*                                                                        07/28/1989                                            TI-13495  Pat. No. 5 233 690                                                                          07/28/1989                                            TI-11398  Pat. No. 5 140 687                                                                          12/31/1986                                            ______________________________________                                         * = abandoned                                                            

BACKGROUND OF THE INVENTION

Advanced wafer lithography and surface-mount packaging technology areintegrating increasingly complex functions at both the silicon andprinted circuit board level of electronic design. Diminished physicalaccess is an unfortunate consequence of denser designs and shrinkinginterconnect pitch. Designed-in testability is needed, so that thefinished product is still both controllable and observable during testand debug. Any manufacturing defect is preferably detectable duringfinal test before a product is shipped. This basic necessity isdifficult to achieve for complex designs without taking testability intoaccount in the logic design phase, so that automatic test equipment cantest the product.

In addition to testing for functionality and for manufacturing defects,application software development requires a similar level of simulation,observability and controllability in the system or sub-system designphase. The emulation phase of design should ensure that an IC(integrated circuit), or set of ICs, functions correctly in the endequipment or application when linked with the software programs.

With the increasing use of ICs in the automotive industry,telecommunications, defense systems, and life support systems, thoroughtesting and extensive real-time debug becomes a critical need.

Functional testing, wherein a designer is responsible for generatingtest vectors that are intended to ensure conformance to specification,still remains a widely used test methodology. For very large systemsthis method proves inadequate in providing a high level of detectablefault coverage. Automatically generated test patterns would be desirablefor full testability, and controllability and observability are keygoals that span the full hierarchy of test (from the system level to thetransistor level).

Another problem in large designs is the long time and substantialexpense involved. It would be desirable to have testability circuitry,system and methods that are consistent with a concept ofdesign-for-reusability. In this way, subsequent devices and systems canhave a low marginal design cost for testability, simulation andemulation by reusing the testability, simulation and emulationcircuitry, systems and methods that are implemented in an initialdevice. Without a proactive testability, simulation and emulationapproach, a large of subsequent design time is expended on test patterncreation and grading.

Even if a significant investment were made to design a module to bereusable and to fully create and grade its test patterns, subsequent useof module may bury it in application specific logic, and make its accessdifficult or impossible. Consequently, it is desirable to avoid thispitfall.

The advances in IC design, for example, are accompanied by decreasedinternal visibility and control, reduced fault coverage and reducedability to toggle states, more test development and verificationproblems, increased complexity of design simulation and continuallyincreasing cost of CAD (computer aided design) tools. In the boarddesign the side effects include decreased register visibility andcontrol, complicated debug and simulation in design verification, lossof conventional emulation due to loss of physical access by packagingmany circuits in one package, increased routing complexity on the board,increased costs of design tools, mixed-mode packaging, and design forproduceability. In application development, some side effects aredecreased visibility of states, high speed emulation difficulties,scaled time simulation, increased debugging complexity, and increasedcosts of emulators. Production side effects involve decreased visibilityand control, complications in test vectors and models, increased testcomplexity, mixed-mode packaging, continually increasing costs ofautomatic test equipment even into the 7-figure range, and tightertolerances.

SUMMARY OF THE INVENTION

Among the objects of the present invention are to provide improvedemulation, simulation and testability architectures and methods whichprovide visibility and control without physical probing or special testfixtures; to provide improved emulation, simulation and testabilityarchitectures and methods which are applicable to critical components ofsystem designs to support test and integration of both hardware andsoftware; to provide improved emulation, simulation and testabilityarchitectures and methods that are a viable alternative to highcapital-cost test equipment and systems; to provide improved emulation,simulation and testability architectures and methods which integrateaccess to sophisticated operations in hardware emulation, faultemulation, simulation and built-in test; to provide improved emulation,simulation and testability architectures and methods which applyhardware and software visibility and control to reduce applicationdevelopment time and thus reduce the user manufacturer's time-to-marketon new products; and to provide improved emulation, simulation andtestability architectures and methods to leverage hierarchicalpartitioning and automatically generate reusable tests for related chipsand systems.

Generally, one form of the invention is an emulation device including anelectronic device having addressable storage elements and a bus so thatthe storage elements are accessible via the bus, an address registerconnected to the bus, a data register connected to the bus, terminalsfor serial scan-in and scan-out, a scanable emulation control registercoupled to the terminals, and a selecting circuit responsive to bits inthe emulation control register for coupling the address register and thedata register to the terminals to enable scanning of the address anddata registers.

Other device, system and method forms of the invention are alsodisclosed and claimed herein. Other objects of the invention aredisclosed and still other objects will be apparent from the disclosureherein.

BRIEF DESCRIPTION OF THE DRAWINGS

The novel features believed characteristic of the invention are setforth in the appended claims. The preferred embodiments of the inventionas well as other features and advantages thereof will be be bestunderstood by reference to the detailed description which follows, readin conjunction with the accompanying drawings, wherein FIGS. 1-43 areincorporated from U.S. Pat. No. 5,072,418 and wherein:

FIG. 44 is a pictorial diagram of development tools for developingintegrated circuit chips and software;

FIG. 45 is a partially pictorial, partially block diagram of a systemconfiguration for emulation, simulation, testability and attachedprocessor data processing, communications I/O and peripheral access;

FIG. 46 is a diagram of a software configuration for a host computer ofFIG. 45;

FIG. 47 is a block diagram of a modular port scan (MPSD) arrangement;

FIG. 48 is a block diagram of a scan test/MPSD configuration;

FIG. 49 is a block diagram of an integrated approach to test andemulation circuitry;

FIG. 50 is a partially block, partially schematic diagram of a scantestability interface;

FIG. 50A is a state transition diagram of a test access port (TAP)controller in FIG. 50;

FIG. 51 is a block diagram of processor chip domains, boundary scan andscan test/emulation circuitry on chip;

FIG. 52 is a block diagram of the processor chip of FIG. 51 showingfunctional blocks of the chip allocated to the various domains, andshowing a message passing circuit;

FIG. 53 is partially pictorial, partially block diagram of the processorchip of FIGS. 51 and 52;

FIG. 54 is a block diagram of scan paths in greater detail than that ofFIG. 50;

FIG. 55 is a block of scan paths in greater detail than that of FIG. 54;

FIG. 56 is a block diagram of connections of a control adapter to thedomains, showing nomenclature;

FIG. 57 is a block diagram of modules in the domains, also illustratinga mode-driven stops process;

FIG. 58 is a process diagram of operation of the system of FIGS. 45, 50,57, and 59 for emulation, simulation and testability;

FIG. 59 is a detailed block diagram of the adapter of FIGS. 49, 51, 52,53, 56 and 57;

FIG. 59A is a compact diagram of shift register latches SRLs in a scanchain in FIG. 59;

FIG. 60 is a schematic diagram of a code state machine and an eventmanager circuit therefor in the adapter of FIG. 59;

FIG. 61 is a state transition diagram of the code state machine of FIG.60;

FIG. 62 is a schematic diagram of selection and flip-flop circuitry ofthe adapter of FIG. 59;

FIG. 63 is a schematic diagram of a lock control circuit of the adapterof FIG. 59;

FIG. 64 is a schematic diagram of one of three identical logic circuitsof the adapter of FIG. 59 supplying codes to a domain;

FIG. 65 is a schematic diagram of one of three identical clock controlcircuits of the adapter of FIG. 59 for switching functional clock FCLKor test clock JCLK to a domain;

FIG. 66 is a pictorial diagram of a testing system for testing numerousintegrated circuits on a wafer in wafer fabrication;

FIG. 67 is a process flow diagram of operation of the testing system ofFIG. 66;

FIGS. 68A and 68B are two halves of a block diagram of a centralprocessing unit CPU core improved for emulation, simulation andtestability;

FIG. 69 is a block diagram of an analysis circuit for monitoring theoperations of an integrated circuit device;

FIG. 70 is a process flow diagram of operations of the analysis circuitof FIG. 69;

FIG. 71 is a block diagram of a hardware breakpoint circuit in FIG. 68A;

FIG. 72 is a block diagram of a trace stack in FIG. 68A;

FIG. 73 is a process flow diagram of operations of the trace stack and aprogram counter stack of FIG. 68A;

FIG. 74 is an address map of a processor device;

FIG. 75 is a time-series diagram of the contents of the program counterstack and not the trace stack;

FIG. 76 is a partially pictorial, partially block diagram of a systemfor simulated peripheral accesses;

FIG. 77 is a process flow diagram of operations of the system of FIG.76;

FIG. 78 is a block diagram of the message passing circuitry of FIG. 52;

FIG. 79 is a process flow diagram of an attached processor method ofoperating the system of FIG. 45;

FIG. 80 is a block diagram of a graphic system processor GSP chip;

FIG. 81 is a more detailed block diagram of a CPU portion of the GSPchip of FIG. 80 showing testability, emulation and simulation circuitry;

FIG. 82 is a waveform diagram of clock waveforms for operating the GSPchip of FIG. 80;

FIG. 83 is a schematic of a parallel register latch for use in the GSPchip of FIG. 80;

FIG. 84 is a schematic of a serial register latch for use in the GSPchip of FIG. 80;

FIG. 85 is a block diagram of a control read only memory (CROM) for theGSP chip of FIG. 80;

FIG. 86 is a detailed block diagram of signature analysis test circuitryfor the CROM of FIG. 85; and

FIG. 87 is a schematic diagram of a cell in the signature analysis testcircuitry of FIG. 86.

Corresponding numerals and other corresponding symbols refer tocorresponding parts in the various Figures of drawing except where thecontext indicates otherwise.

DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS

Various inventive electronic architectures, devices, systems and methodswere described extensively in the detailed description and drawings 1-43of U.S. Pat. No. 5,072,418. Numbering of Figures in the presentapplication begins with FIG. 44 to continue the sequence of detaileddescription. Corresponding numerals in this application and saidcoassigned applications refer to corresponding parts for clarity ofexposition.

A device 11, described in the coassigned applications and furtherdescribed herein, is adapted for sophisticated interfacing withdevelopment tools illustrated in FIG. 44. Hardware design tools includean extended development system 1101 interfaced by a serial line 1103 toa circuit board 1043 holding device 11. Circuit board 1043 isadvantageously operable with application host computer 1044. Alsoprovided in the development tools are an evaluation module 1111connected to an analog interface board AIB 1113.

A software development system SWDS provides for user entry of sourcecode 1121 in the C computer language which source code then is compiledby a C compiler 1123 into code 1125.

C compiler 1123 is an optimizing compiler fully implementing thestandard Kernighan and Ritchie C language, for instance. The compiler1123 accepts programs written in C and produces assembly language sourcecode, which is then converted into object code by assembler 1127. Thishigh-level language compiler 1123 allows time-critical routines writtenin assembly language to be called from within the C program. conversely,assembly routines may call C functions. The output of the compiler issuitably edited before assembly and link to further optimize theperformance of the code. The compiler 1123 supports the insertion ofassembly language code into C source code, so that the relativeproportions of high-level and assembly language code are tailoredaccording to the needs of a given application.

The code 1125 is assembled by an assembler 1127 into relocatable objectcode. A linker 1129 produces non-relocatable machine code or linkedobject code which is then downloaded into the device 11 through thedevelopment system.

Assembler 1127 and linker 1129 comprise a software development tool thatconverts assembly language files into executable object code. Keyfeatures are macro capabilities and library functions, conditionalassembly, relocatable modules, complete error diagnostics, and symboltable and cross reference. Four programs address specific softwaredevelopment needs, discussed next.

The assembler 1127 translates assembly language source files intomachine language object files. Source files contain instructions,assembler directives and macro directives. Assembler directives are usedto control various aspects of the assembly process, such as the sourcelisting format, data alignment and section content.

The linker 1129 combines object files into a single executable objectmodule. As the linker creates an executable module, it performsrelocation and resolves external references. The linker acceptsrelocatable object files created by the assembler as input. It alsoaccepts archive library members and output modules created by a previouslinker run. Linker directives allow combining or binding of filesections or symbols to addresses and defining or redefining globalsymbols.

An archiver allows collection of a group of files into a single archivefile. For example, several macros are suitably collected into a macrolibrary. The assembler searches through the library and uses the membersthat are called as macros by the source code 1125. The archiver alsosuitably collects a group of object files into an object library such asfiles that resolve external references during linking.

An object format converter converts an object file into any one ofseveral EPROM programmer formats, such as TI-TAG format. The convertedfile is then downloaded to an EPROM programmer so that the EPROM code soestablished is then executed on the device 11 target chip in system1043.

Simulator 1131 executes a software program that simulates operation ofthe target chip for cost-effective software development and programverification in non-realtime. The simulator simulates the entire targetchip instruction set and simulates the key peripheral features includingDMA, timers and serial port when the target chip includes them. Commandentry is accepted from either menu-driven keystrokes (menu mode) or froma batch file (line mode). Help menus are provided for all screen modes.Its standard interface can be user customized. Simulation parameters arequickly stored/retrieved from files to facilitate preparation forindividual sessions. Reverse assembly allows editing and reassembly ofsource statements. Memory is displayed as hexadecimal 32 bit values andassembled source code, separately or at the same time.

Simulator 1131 execution modes include 1) single/multiple instructioncount, 2) single/multiple cycle count, 3) Until Condition Is Met, 4)while Condition Exists, 5) For Set Loop Count and 6) Unrestricted Runwith Halt by Key Input. Trace expressions are readily defined. In traceexecution, display choices include 1) designated expression values, 2)cache registers, and 3) instruction pipeline for easy optimization ofcode. Breakpoint conditions include Address Read, Address Write, AddressRead or write, Address Execute, and Expression Valid. Simulator 1131simulates cache utilization and does cycle counting. For example, incycle counting the number of clock cycles in single step mode or runmode are displayed. External memory is suitably configured with waitstates for accurate cycle counting.

Simulator 1131 accepts object code produced by the assembler 1127 andlinker 1129. Input and output files are suitable associated with theport addresses of the I/O instructions to simulate I/O devices connectedto the processor. Before starting program execution, any breakpoints areset and the trace format defined.

During program execution on simulator 1131, the internal registers andmemory of the simulated target chip are modified as each instruction isinterpreted by the simulator 1131. Execution is suspended when abreakpoint or error is encountered or when execution is halted. Whenprogram execution is suspended, the internal registers and both programand data memories can be inspected and modified. A trace memory is alsodisplayable. A record of the simulation session can be maintained in ajournal file so that it can be re-executed to regain the same machinestate during another simulation session.

The simulator 1131 allows verification and monitoring of the state ofthe target chip without the requirements of hardware. Simulation speedis on the order of hundreds or thousands of instructions per seconddepending on the operating system and hardware selected for simulator1131. A state-accurate simulation might be as slow as 1-2 instructionsper second. Emulation at the higher real-time functional clock rate isperformed by development system 1101 instead of simulator 1131.

Simulator 1131 provides for complete computer simulation not only of thedevice 11, but also its peripherals on the board 1043 through file I/Ofor example.

Extended development system 1101 provides full-speed, in-circuitemulation for system design and for hardware and software debug onwidely available personal computer systems. The development toolsprovide technological support from system concept to prototype. Thedevelopment system elements provide ease of use and offer the designerthe tools needed to significantly reduce application system developmenttime and cost to put designs into production faster.

FIG. 45 illustrates in even more detail the emulation environmentprovided by the extended development system 1101. A controller card 1141compatible with IEEE JTAG standards is included in the emulation hostcomputer 1101. This controller card 1141 communicates by serial line1193 to PC board 1043 and DSP device 11 of FIG. 45. System 1043 hasTexas Instruments Scope (TM) testability meshed with Texas InstrumentsMPSD (Modular Port Scan Design) emulation for a complete solution fromdevelopment, through manufacture, and including field test. Theinventive approaches are applicable in digital signal processors (DSP),graphics signal processors (GSP), memories (MEM), programmable arraylogic (PAL), application specific integrated circuits (ASIC), andgeneral purpose logic (GPL) general purpose Micro Computers and Microprocessors, and any device requiring test or code development.

Host computer 1101 of FIG. 45 has peripherals including a printer 1143,hard disk 1145, and telecommunications modem 1147 connected to atelephone line for uploading to a remote mainframe in field test andother procedures. The peripheral capabilities of bus 1148 of hostcomputer 1101 are not only available for emulation, but also provideaccess by application system 1043 to these peripherals along serial line1103. Host computer 1101 thus is not only available to the system 1043as an emulation host but also as an attached processor itself and as aport for communications I/O and to other peripheral capabilitiestemporarily needed by system 1043 but ordinarily unavailable to system1043.

FIG. 46 illustrates an emulation and simulation software configurationfor computer 1101 wherein device independent emulator software has awindow driven user interface and a test executive program.

Device specific configuration files for each of the devices on board1043 are provided. For example, there is a DSP configuration file, a GSP(graphic signal processor) configuration, a programmable array logic(PAL) file, an ASIC file and a GPL register file.

The emulation hardware and software of FIGS. 45 and 46 provide auser-friendly, personal-computer or work station-based developmentsystem which provides all the features necessary to perform full-speedin-circuit emulation with target chips on board 1043. For example, DSP11 is suitably a Texas Instruments 320 series digital signal processordisclosed in coassigned applications Ser. Nos. 025,417, 025,443, 025,756and 025,413 all filed Mar. 13, 1987 and hereby incorporated herein byreference; or a 320C50 digital signal processor disclosed in applicationTI-14079, Ser. No. 347,605 filed May 4, 1989, and its above identifiedcofiled coassigned applications, all of which applications areincorporated herein by reference. An exemplary graphics signal processoris the Texas Instruments 34020 GSP disclosed in the GSP coassignedapplications incorporated hereinabove and having inventive emulationcircuitry more fully described hereinbelow.

The emulator comprised of FIG. 45 host computer 1101 with controllercard 1141 and software of FIG. 46 allows the user to perform softwareand hardware development, and to integrate the software and hardwarewith the target system. An important emulation interface providescontrol and access to every memory location and register of the targetchip and extend the device architecture as an attached processor.

Emulator controller card 1141 provides full-speed execution andmonitoring of each target chip such as device 11 in the user's targetsystem 1043 via a multi-pin target connector. In one embodiment, thirtysoftware and hardware breakpoints, software and hardware trace andtiming, and single-step execution are provided. The emulator hascapability to load, inspect, and modify all device 11 registers. Programdata and program memory can be uploaded or downloaded. The userinterface of host computer 1101 for emulation purposes is a windoweduser interface designed to be identical to the windowed user interfaceof simulator 1131 for the corresponding target chip. The emulator 1101is portable and reconnectable for multiprocessing. Emulator 1101provides a benchmark of execution time clock cycles in realtime.

Full-speed execution and monitoring of the target system is suitablycontrolled via a multi-wire interface or scan path in the multi-pintarget connector. The scan path controls the target chip in the system1043, providing access to all the registers as well as associatedinternal and external memory.

Program execution takes place on the target chip (e.g. 11) in the targetsystem 1043. Accordingly, there are no timing differences duringemulation, as might occur without the in-circuit emulation provided bythis preferred embodiment. Heretofore, emulation may have involvedsending signals over a cable to emulate the target chip 11 in itsabsence. Advantageously, the present embodiment is a non-intrusivesystem that utilizes chip 11 itself, and avoids cable length andtransmission problems. Loading problems on signals are avoided, andartificial memory limitations are obviated. Emulation performancecoincides with specifications for the emulated target chip itself.

Software breakpoints allow program execution to be halted at a specifiedinstruction address. Hardware breakpoints are also advantageouslyoperative on-chip. When a given breakpoint is reached, the programeither halts execution to permit user observation of memory and statusregisters, or the breakpoint is included in a more complex condition,which when satisfied results in an appropriate stop mode being executed.At this point, the status of the target chip or system is available fordisplay by the user with as little as a single command.

Software trace and hardware program counter trace permit the user toview the state of target chip 11 when a breakpoint is reached. Thisinformation is suitably saved on command in a file for future analysis.Software timing allows the user to track clock cycles betweenbreakpoints for benchmarking time critical code.

Single-step execution gives the user the ability to step through theprogram one instruction at a time. After each instruction, the status ofthe registers and CPU are displayed. This provides greater flexibilityduring software debug and helps reduce development time.

Object code is downloaded on command to any valid program memorylocation or data memory location via the interface. Downloading a1K-byte object program illustratively takes on the order of 100milliseconds. By inspecting and modifying the registers whilesingle-stepping through a program, the user can examine and modifyprogram code or parameters.

A windowed user interface for emulator 1101 is suitably made identicalto that of simulator 1131, affording a straightforward migration fromsimulator-based development to emulator-based development. Theuser-friendly screen displays the program code in mnemonics andequivalent hexadecimal code. Windowed displays are suitably provided forextended precision registers, the CPU status and memory locations.

A first screen option is a primary screen that includes a command linedisplayed at top of screen, functions of special-function keys, and fourstatus windows which are individually accessed using the F1 key ofcommercially available keyboards. The windows include a source codewindow, an auxiliary display window, a CPU status window, and anextended precision registers window. The contents of the windows aremade accessible for user inspection and modification.

Commands are entered in a MENU mode or a LINE mode. In the MENU mode, amenu at the top of the screen permits the user to view every optionavailable while entering a single command. Further menus are thendisplayed until the entire command has been entered. The LINE modeallows user to enter an entire command expression. A summary of commandsis provided in the appendix.

Emulator card 1141 of FIG. 45 suitably occupies slots in an IBM PC-XT/ATcomputer when the latter is used as host computer 1101. The card 1141 isdetached and transferred to another PC (personal computer of equivalentfunctionality) as needed, affording emulator portability. Forsimulation, a memory map for the controller card 1141, which may includeEPROM (erasable programmable read only memory), SRAM (static randomaccess memory), DRAM (dynamic random access memory), and on-chip memoryand peripherals, can be configured by the designer to reflect the actualenvironment of the target system 1043, including wait states and accessprivileges. In this way, card 1141 and host computer 1101 simulateperipherals which are as yet absent from board 1043 in a particulardevelopment context.

In one embodiment, multiprocessing applications are emulated byextending line 1103 between each of several application boards from oneto the next, maintaining real-time emulation and preserving theinformation on each target chip.

The development system 1141 operates in two modes: emulation mode andalgorithm development and verification mode. In the algorithmverification mode, the target chip 11 debugs its software at full speedbefore the target system is complete. To accomplish this, code isdownloaded into the memory on the board 1043 and executed at full speedvia the interface on an application board used in place of theincomplete target system. A suitable application board includes a DSP11, 16K×32 bits of full-speed (zero wait states) SRAM on a primary bus,two selectable banks of 8K×32 bits full speed (zero wait state) SRAM onan expansion bus, and 512K×32 bits DRAM. With ample SRAM, the user hasrealtime emulation capabilities and memory storage flexibility for avariety of algorithms. Zero wait state capability in SRAM allows memoryread/write in realtime.

For algorithim development and code verification the system can singlestep and run until breakpoint is reached. Algorithim verification runsdata through the algorithim and verifies its function. Burst execution,I/O and other functions are available.

Page mode DRAM improves bulk storage performance. Three types of DRAMcycles are used on one example of an application board. These aresingle-word read, single-word write and page-mode read whichrespectively have wait states of four, two, and one wait state peraccess. Page mode read cycles are automatically evoked when device 11performs two or more back-to-back read cycles on the same memory page(256 words). Utilizing page-mode results in a decrease in wait stateswhen accessing on application board 1043 DRAM on application board 1043.

In FIG. 45 both test and development support system access to theapplication system resource is via a serial scan bus master or scaninterface on controller card 1141, and described later hereinbelow.Sophisticated emulation and simulation functions are built out ofprimitives. Primitives are sets of bits that define control operations(like commands or instructions) available through controller card 1141.

The functionality of the device 11 can be accessed by each of twoillustrative inventive serial implementations. A first implementation isTexas Instruments Modular Port Scan Design (MPSD) as shown in FIG. 47and disclosed in coassigned U.S. Pat. No. 4,860,290. Shift registerlatches (SRLs) designated "S" are distributed through the device 11 likea string of beads on a serial scan path respective to each module toprovide access to all important registers.

In FIG. 48, a second approach uses a SCOPE transmission medium combinedwith MPSD technology in a SCOPE interface 1150.

In FIG. 49 device 11 has an on-chip JTAG interface 1149 as describedherein. The scan interface is connected to line 1103 of FIG. 45 and hasinputs for test clock TCK, mode select TMS, and test data input TDI(scan in), as well as a test data output TDO (scan out). A specialemulation adapter 1203 is connected between the scan interface 1149 andMPSD modules of the functional circuitry 1213 of device 11. Emulationadapter 1203 in different forms involves hardwired state machinecircuitry, assembly language, or microcoded state machine embodiments.

The characteristics of some implementations when used in support ofemulation are shown in Table I:

                  TABLE I                                                         ______________________________________                                                    MPSD    SCOPE     SCOPE/MPSD                                      ______________________________________                                        Industry Standard                                                                           No        Yes       Yes                                         Communication                                                                 Max Clock Period                                                                            Depends   Unlimited Unlimited                                   Functional Clock                                                                            No        Yes       Yes                                         Independence                                                                  Boundary Scan Support                                                                       No        Yes       Yes                                         Silicon Efficiency                                                                          Yes       No        Yes                                         Most Emulation Capability                                                                   No        Yes       Yes                                         Number of Extra Pins                                                                        Four      Six       Six                                         ______________________________________                                    

The implementation SCOPE/MPSD capitalizes on the strengths of MPSD andSCOPE individually to create a hybrid emulation technology.

FIG. 50 shows a block diagram of improved SCOPE hardware which isprovided on each of the chips such as device 11 on PC board 1043. Fourpins TDI, TMS, TCK and TDO communicate with the system. TMS and TCKcommunicate with a tap controller 1151 which is connected to aninstruction register 1153 and an instruction decoding circuit 1155.

Test access port (TAP) controller 1151 is in turn coupled to instructionregister (IR) 1153 and a first multiplexer 1173. The instructionregister can receive serial scan signals from the TDI line and outputserially to MUX 1173. MUX 1173 is under control of the TAP and canselect the output signal from the instruction register or from anotherMUX 1171.

The instruction register also controls a bypass register (BR) 1167 andone or more boundary scan registers (BSR) 1161. The bypass registerreceives the TDI signal and outputs it to MUX 1171. MUX 1171 is undercontrol of the instruction register 1153. Based on the instructionloaded into the instruction register, MUX 1171 outputs its input fromthe bypass register or its input from one or more BSRs, or internaldevice register scan. Each boundary scan register is controlled via thetest access port and the instruction register.

The boundary scan arrangement operates in a normal mode or a test mode.During the normal mode, input data entering terminals of IC logic passesthrough the boundary scan register, into the IC logic and out to thenormal output terminals without any change due to the BSR. During thetest mode, normal input data is interrupted, and test input data iscaptured, shifted, and updated within the boundary scan register. Theboundary scan register includes two memories, a first memory forreceiving and shifting data from the TDI line and a second memory forholding output data. The second memory is selectively operable totransfer data from the first memory to the second memory.

Generally, in FIG. 50, serial information is down loaded from emulationcomputer 1101 via the SCOPE controller card 1141 through pin TDI andenters any one of a number of shift registers, including a boundary scanregister 1161, a device identification register 1163 and design specifictest data registers 1165. A bypass register 1167 is also provided. Theseshift registers or serial scan registers are selected via a MUX 1171under the control of instruction decode circuitry 1155. The selectedoutput from MUX 1171 is fed to a MUX 1173 so that under control of tapcontroller 1151 the instruction register 1153 or MUX 1171 is selected byMUX 1173. JTAG clock TCK and MUX 1173 output are fed to flip flop 1175which in turn is connected to a serial return circuit 1177 which issuitably enabled to return or send serial outputs from all parts of theon-chip JTAG circuitry back to computer JTAG card 1141 via output serialpin TDO.

In FIG. 50A a state transition diagram of TAP controller 1151 has oneand zero signal values entered adjacent to each state transition arc.These are values of signal TMS at the time of a rising edge on signalTCK. The states of the JTAG TAP (Test Access Port) controller aredescribed in "VA Standard Test Bus and Boundary Scan Architecture" by L.Whetsel, Texas Instruments Technical Journal, Vol. 5, No. 4, 1988, pp.48-59 and in above-referenced documents TI-12016, TI-13371, TI-13363 andTI-12015.

Turning to basic concepts recognized and utilized herein, emulationinvolves hardware support built around each circuit so that operationscan be executed within the circuit while doing analysis in parallel asthe circuit runs. Emulation permits the circuits to be run at full speedin real time as the emulator computer 1101 monitors the circuits andstarts and stops them. The user defines and develops software in theenvironment of the target system. Put another way, emulation readsinputs from the board 1043 and produces outputs to the board as ifdevice 11 were absent, for the purpose of determining appropriatesoftware and operation signals. Ultimately, when the device 11 issupplied with the appropriate software resulting from emulation work,the device 11 operates in a manner which is compatible with the rest ofthe circuitry of board 1043. Advantageously, in the improved systemdisclosed herein, the device 11 is actually on the board and with theserial communication capabilities, all of the operations of device 11are monitored directly from the device itself. In view of the extremelyhigh speed of device 11, the device itself assists in its own emulation.

In a previous approach, a cable is terminated in a pin-plug that matesto a socket provided on the board in place of the emulated device. Thesocket introduces a noise issue. A socket may be impractical when asurface mount device is to be emulated, due to limited board space.Advantageously, device 11 is soldered onto board 1043 and emulation ismediated by the device itself.

The few pins utilized by the scan interface 1150 eliminate the need forconventional full pin-out target connectors and eliminate problemsassociated with cable reliability, transmission effects and timingdifferences. In this way, board 1043 can be probed with logic analyzersand oscilloscopes in the improved system without physical orelectromagnetic interference from a heavy cable. Moreover, clock ratesin excess of 20 megahertz for device 11 are so fast that previousemulation schemes may be incapable of emulating it.

Simulation as the term is used herein creates a software representationof the target board 1043 so that the entire board can be developed insimulation on simulator 1131 of FIG. 44 (or by running the simulatorprogram on computer 1101). In another aspect of simulation, when thedevice 11 is available but the rest of the circuitry for target board1043 is incomplete, the simulator can mimic the planned complete boardby serial scan upload or download from device 11 to computer 1101, andthen serial scan download or upload from computer 1101 to device 11 insubstitution for the missing circuitry of board 1043. In this aspect,simulation is accelerated by running the device 11 itself at full speedaccording to the improvements described herein. Even when computer 1101runs at a slower speed than device 11, simulation is effective tosimulate peripherals which are accessed infrequently by device 11.

Test as the term is used herein has four different areas. The firstarea--Device Test--is test of a device 11 itself before the devicemanufacturer ships it.

The second area of test is Device Verification--verification of fullfunctionality of the device in every aspect.

The third area of test is Device Characterization. Characterizationdetermines timings of the device to define exactly the way the actualmanufactured device works.

The fourth area of test is User Test. In user test, the entire board istested so that the functionality of device 11 in the context of theentire board 1043 is examined.

Returning to FIGS. 47 and 48, each MPSD module has two scan paths. Oneof the scan paths is termed the MPSD data path which usually hasnumerous shift register latches 8 (or SRL) serially interconnected likea string of beads throughout the module. The second scan path is termedthe MPSD control path which generally has fewer shift register latchesand which selects which MPSD data paths are to be scanned. These scanpaths are described in above-cited U.S. Pat. No. 4,860,290.

In FIGS. 49 and 51, the improved emulation arrangement recognizes thatdevice 11 is dividable into a few major areas which are clocked bydifferent clocks when desired. These major areas are called clockdomains or just "domains". The domains in a DSP device such as device 11are suitably a CPU core domain, memory and peripherals (system) domainand an analysis domain. For another chip, the domains can defined inwhatever manner is consistent with the parts of the chip that are to besometimes clocked from different clocks. However, for modularity of chipdesign, emulation and test, the modules should usually be smaller unitsthan a whole domain. This affords greater flexibility in designing otherchips using the modules as building blocks, and reduces the timerequired to scan data into modules (the time is a nonlinear powerfunction of the size of the modules).

Accordingly, it is contemplated that each domain usually include morethan one module. In FIG. 49, emulation adapter 1203 directs differentclocks to the different domains or may supervise bit by bit transfersbetween the scan interface and a specific domain. Furthermore, adapter1203 directs different MPSD control signals to the control paths of thedifferent domains.

In FIG. 51, the on-chip emulation blocks are further illustrated whereinJTAG control is wrapped around the emulation according to MPSD (ModularPort scan Design). Principles of modular scan testing are also disclosedin coassigned U.S. Pat. No. 4,701,921 which is also incorporated hereinby reference.

The JTAG control of FIG. 50 is indicated as JTAG control block 1201 ofFIG. 51. Emulation control according to MPSD is provided as a block1203. Test control block 1205 links JTAG to MPSD. Serial scan line 1207enters the serial bit stream into any one or more of the selected areasof boundary scan area 1211 which includes BSR 1161 of FIG. 50 and scansthe pin boundary of device 11. The FIG. 51 domains--CPU core domain1213, system domain 1215 and analysis domain 1217 are shown in FIG. 50and interface through the shift register latches of FIG. 47 to all ofthe various parts of the chip.

FIG. 52 provides a further perspective of the domains of device 11. TheCPU core domain 1213 includes the circuitry of incorporated-by-referenceFIGS. 1A and 1B. Analysis circuitry is connected to the CPU core asdescribed more fully herein. The analysis circuitry includes conditionsensors such as hardware breakpoint sensors for controlled stops andtrace stack circuitry for real-time trace recordkeeping. The analysiscircuitry is serial-scan accessible and designated the analysis domain1217. All peripherals including memory and serial and parallel ports aredenominated as the system domain 1215. For uniformity of description,JTAG control 1201 is regarded as a clock domain also in which test clockJCLK is active. Emulation control circuitry 1203 is a further domain ofFIG. 52. Special message passing circuitry 1216 is also included in thesystem or analysis domain, to even more fully use the host computer 1101as an attached processor by interfacing the TIBUS to the serial scanline 1103 of FIG. 45.

FIG. 53 shows a physical perspective of the various domains on the chipof device 11. JTAG control 1201 interfaces with the pins via a serialboundary scan assembly including boundary scan register 1161 whichallows all logic states at the actual pins of device 11 to be read orwritten. JTAG TAP controller 1151 and JTAG instruction register IR 1153are provided on-chip. Test control 1205 and MPSD control 1203 areintegrated into the circuitry. MPSD control 1203 serially interfaceswith the domains for core 1213, system 1215 and analysis 1217 for thedevice 11. Bi-directional pins EMU0 and EMU1 are provided for externalinterfacing in addition to the four JTAG terminals 1221. Combining JTAGtestability interface technology with MPSD modular port scan with theadditional pins EMU0 and EMU1 synergistically opens up capabilities forintegrating emulation, software development, and manufacturing and fieldtest processes.

A medical analogy assists in describing the overall concept of thisremarkable emulation feature. Device 11 is analogous to a human patienton a medical operating table wherein a dialysis machine and an electrocardiogram are connected to different parts of the patient's body. Whilethe patients heart (functional clock FCLK) is pumping blood through thepatient's torso and head (CPU core), the dialysis machine (test clockJCLK) is forcing blood through the vessels of the patient's legs(peripherals in system domain) in substantial isolation from thepatient's heart. An electrocardiogram is attached to a separate part ofthe patient's body. All of these medical and physiological functions areoperating at the same time so that the emergency medical needs of thepatient are fulfilled in the shortest amount of time. Correspondingly,device 11 can have its own system clock FCLK running at full speed torun part of device 11 while another part of device 11 is operated by adifferent clocking system JCLK under the JTAG/MPSD control and then in athird feature, the JTAG control can be controlling, the JTAG boundaryscan. Moreover, the parts of each chip are selectively fed FCLK or JCLKupon command, affording a dynamic control process. In this way, thedevelopment requirements of the device 11 are fulfilled in an integratedmanner in the shortest possible time.

In FIGS. 52 and 53, the development system capabilities for thepreferred embodiments address applications development support in afashion that allows the selection of a range of capability. Utilizingall of the disclosed development support hardware components providesdevelopment capabilities that include concurrency, ANALYSIS for on-chipbreakpoint and trace, and realtime message passing MSGPASS between theemulation controller 1101 of FIG. 45 and the device 11 of FIG. 52.Various sections of the hardware support of FIG. 52 can be included oromitted in cost sensitive applications. For example, a basic systemwould support basic MPSD (Modular Port Scan Design) emulation or at theextreme, no emulation and only test with or without a boundary scan.

The total development systems advantages in the areas of emulation,simulation, and chip speed measurement interrelate with various test andfunctional features. The preferred embodiments have three architectures,a) functional architecture, (e.g., CPU memory and I/O), b) testarchitecture including JTAG and MPSD serial scan-based testabilitycircuitry and c) emulation/support architecture such as message passingcircuitry, simulation features, and boundary scan test. The threearchitectures advantageously minimize complication of the CPU, memoryand I/O functional architecture and maximize the synergism with test.

The support architecture of FIGS. 51 and 52 provides means to match costand capability requirements through the life cycle of the device 11. Thesupport capability is deletable for devices created for some marketsegments. This partitioning does not affect the testability of thedevice by a test control 1205 of FIG. 51.

In this way, a hierarchical scan architecture combines and improves ascan support/test front end with an MPSD interface as in FIG. 51.

The architecture of FIG. 51 provides uniform interfaces for boundaryscan 1211, CPU core 1213, analysis 1217 and memory and peripherals 1215which allow the selection of capability based on the choice of blocks1215-1217 used.

Table II below describes the levels of capability created whenadditional hardware blocks are added to the CPU and system domains.

                  TABLE II                                                        ______________________________________                                                 JTAG  TEST    EMUL.          MBG.                                             CON-  CON-    CON-    ANALY- PERIPH-                                          TROL  TROL    TROL    SIS    ERAL                                    ______________________________________                                        MPSD only                                                                     MPSD Test and                                                                 Emulation                                                                     MPSD Test,                       x                                            Analysis,                                                                     and Emulation                                                                 JTAG Device Test                                                                         x       x                                                          JTAG Emulation                                                                           x       x       x                                                  Concurrency                                                                   JTAG Emulation                                                                           x       x       x     x                                            Concurrency                                                                   with Analysis                                                                 JTAG Emulation                                                                           x       x       x     x      x                                     Concurrency,                                                                  Analysis, Message                                                             Passing                                                                       ______________________________________                                    

Referring to FIG. 52 and recapitulating, support architecture views thedevice 11 as the following five distinct clocking domains in order tocontrol domain data transfers with the scan clock (JCLK) and applicationexecution with the functional clock (FCLK).

1) CPU core domain 1213

2) Analysis domain 1217

3) Peripherals, memory, interfaces, and busing (system domain) 1215

4) Emulation control domain 1203

5) JTAG port and boundary scan domain 1201

There are two data path configurations, one for MPSD and one for JTAG.In the JTAG data paths of FIG. 50, data is scanned to and from thedevice 11 through internal scan paths that are selected through a JTAGinstruction register 1153. A unique JTAG opcode for each path allowsentry of and access to internal scan data.

The support architectures utilize two different clocks to support theiroperation. The two clocks are the functional clock (FCLK), and the scanclock (JCLK).

The emulation environment contemplates that some domains have adifferent clock source than others while test operation usually makesthe device 11 fully synchronous and places all domains on the test clockJCLK. The clock separation provided by the domains of FIGS. 51 and 52provides the ability to:

1) Connect all domains independently to either the JCLK or FCLK via theemulation control block 1203.

2) Apply test clock JCLK to all domains for test.

3) Run any domain with functional clock FCLK and then scan its contentswith JCLK.

4) Halt the CPU domain with a stop response compatible with functionalclock FCLK and then scan the CPU domain on test clock JCLK while thesystem domain of FIG. 52 continues to run on FCLK.

Clock domains of FIGS. 51 and 52 and the emulation control 1203 allowindependent selection of functional clock FCLK (chip clock rate dividedby two) or scan clock JCLK (TCK pin of FIG. 50). Each domain 1213, 1215,1217 can have its clock individually selected while other domainselections are locked (unchanged). The selection process is asynchronized transfer of control between JCLK and FCLK in each domain.This transfer mechanism is located in the emulation control 1203 ofFIGS. 49, 51 and 52 as discussed later hereinbelow.

FIG. 54 shows a further diagrammatic perspective of the registers ofFIG. 50 wherein JTAG instruction register IR 1153 is selected for scanbetween the terminals TDI and TDO. The IR 1153 is decoded in FIG. 50 toaccess the other serial shift registers or scan paths when requested bythe control card 1141 of FIG. 45 via the serial line 1103. These shiftregisters are the bypass register 1167, the boundary scan register 1161,the message peripheral 1216 of FIG. 52, the emulation control register1251 and a pair of MPSD scan paths 1252 in the various domains andmodules in the domains.

In FIG. 55, a scan line 1253 from FIG. 54 is denominated SCIN and thisline is selectively connected to three scan paths 1252 wherein each ofthe three paths is internally split by internal MUX selection into aninternal scan control path and a scan data path. A set of external MUXes1261, 1263 and 1265 are controlled by lock signals LOCKS (lock systemdomain), LOCKA (lock analysis domain), and LOCKC (lock core domain) fromemulation control 1203 to bypass all but a selected one domain, if any,for scan and execution purposes. A locked domain has the MPSD codes(discussed hereinbelow) which have been supplied to that domain befrozen for the period the domain is locked. When any one domain (e.g.analysis domain) is to be scanned, its corresponding MUX 1263 deselectsline ASCIN (analysis scan in data) and selects line ASCOUT (analysisscan out). In this way serial scan bits entering line SCIN enteranalysis domain 1217 on line ASCIN, leave analysis domain via lineASCOUT, and bypass the other two domains. Each of the other two domainsis selected analogously. Scan output exits through line SCOUT at thebottom of FIG. 55.

For each domain, MPSD command code bits C0, C1 and CX in FIG. 56 entereach domain from control adapter 1203. These MPSD command code bits C0,C1 and CX are parallel, not serial, and are distinct from scan controlsignals and scan data signals entering a line SCIN for each domain inFIGS. 55 and 56. Particular operations in particular modules in a givendomain are determined by the scan control bits passed into the daisychained modules of a given domain on line SCIN, when a particular codeC1,C0=01 sets the internal selection to receive line SCIN scan bits intoscan control bit SRLs in each module of the domain.

C1 is a one when not scanning and a zero when scanning. C0 and CX aresourced from the emulation control block adapter 1203 register 1251.When host computer 1101 detects Ready to Scan for all unlocked domainsfor a designated device on the target board 1043, C1 and C0 are modifiedwhen in the Scan Data state JSDAT of FIG. 50A to make C1 and C0 both bezero (C1,C0=00) to set the internal selection to receive line SCIN scanbits into scan data bit SRLs in each module of a selected domain. WhenC1,C0=01, then the internal selection is set to receive the SCIN scanbits into scan control SRLs as stated in the previous paragraph.

The command code lines C1,C0,CX, the scan in SCIN and scan out SCOUTlines, and clock lines are shown in FIG. 56. The scan control bits arescanned in on line SCIN to control and select one or more modules in aselected domain. Then scan data bits also on line SCIN are scanned intothe selected domain into the selected one or more modules. Thus, thesystem affords individualized access of the MPSD scan data and scancontrol bits to the system domain 1215, analysis domain 1217 and CPUcore domain 1213.

Identical nomenclature is applied to the domain inputs of FIG. 56 eventhough they are not connected together. Prefixes of S, A and C areapplied to the nomenclature of the outputs of adapter 1203 that go toeach of the domains. For example, AC1 is the C1 output for the A(Analysis) domain from the adapter 1203.

In the control 1203 clock switching circuits (1411, 1413 1415 of FIG.59) fed by FCLK and JCLK individually provide respective domain clocksto clock each of the domains separately or together as desired by theuser. FIG. 56 also shows clock lines SCLK, ACLK, and CCLK going todomain clock inputs DCLK for system domain 1215, analysis domain 1217and CPU domain 1213 respectively. Prefixes of S, A and C are denoted forthe same lines at respective system, analysis, and CPU ports of adapter1203 of FIG. 56.

The MPSD codes are tabulated in Table III:

                  TABLE III                                                       ______________________________________                                        C1  C0    CX     SCIN  SCOUT REMARKS                                          ______________________________________                                        1   1     1      X     1     Functional run, emulation                                                     logic held reset (strap) (7)                     1   1     0      X     1     Execute a command which has been                                              scanned in: Emulation run,                                                    device running (6)                               1   1     0      X     1,0   Emulation run, device halted                                                  on one-to-zero transition                                                     (6)                                              1   0     1      X     1     Halt applied, device still                                                    running. (5)                                     1   0     1      X     1,0   Halt applied, device halted                                                   on one-to-zero transition                                                     (5)                                              1   0     0      X     Do    Scan pause (4)                                                                (Cause serial data transfer                                                   to pause)                                        0   1     X      Di    Do    Scan control path data (2,3)                     0   0     X      Di    Do    Scan data path data (0,1)                        ______________________________________                                    

Since there are two different MPSD scan paths in each module (FIGS. 47and 48 being simplified suggest both paths with only one serpentineloop), the C1,C0 codes act as a selection code. C1,C0=01 selects thecontrol path, whence control bits are scanned in on line SCIN andcontrol information scanned out on SCOUT. C1,C0=00 selects the datapath, whence data bits are scanned in on line SCIN (FIG. 55) and datadeveloped in device 11 scanned out on SCOUT.

When C1=1 (command code C1 active), then control line CX is availablefor defining further codes for a whole domain as tabulated above.

The scan out line SCOUT has a dual function. In a first function SCOUTserves as a handshake or interrupt by representing whether the device isrunning or halted in response to the command entries 7, 6 and 5. In thesecond function, it serves as a line for scanning out serial data in thelast two tabulated codes. Transitions from shift operations (0,1,2,3) toexecute operations (5,6,7) or from execute to shift, preferably includea pause (4) to halt (5) or halt-to-pause sequence. This is notmandatory, but can be used to effect orderly behavior of device 11internal buses and state machines in such transitions.

It is of interest that Pause state 100 electrically borders both thecommand codes above it (herein called Execute codes) in the table aswell as the command codes to scan (herein called Scan codes), below it.

In FIG. 57, the adapter or emulation control block 1203 is used toindependently manage the clock signals that it routes to the CPU,analysis, and system domains 1213, 1217 and 1215 respectively. Block1203 also applies a sequence of the command code triplets (C0, C1, CX)to generate emulation and simulation functions. Each domain has modules,such as 1301.1 and 1301.n in system domain 1215, 1303.1 and 1303.n inCPU core domain 1213, and 1305.1 and 1305.n in analysis domain 1217.Associated with each module is a test port as described in U.S. Pat. No.4,860,290.

Connected to each test port is mode conditioned stop logic circuitry1309S, 1309C and 1309A in the domains respectively. The modes areestablished by a mode register 1311 which is scanable in FIGS. 54 and 57to establish the type of stop and any other desired mode characteristicsfor the domains. The mode conditioned stop logic circuits 1309S, 1309Cand 1309A are respectively fed by MPSD decoders 1313S, 1313C and 1313Athat have multiline outputs to the stop mode conditioned logiccircuitry.

Scan control 1149 scans in an initial state (test vector) into theregisters of device 11 to set up a test or emulation sequence. This isdone with all domains locked, meaning that test clock JCLK is appliedfor scan purposes. When all data and control registers are loaded,circuitry 1149 sends a START signal to adapter 1203. The CPU domain, foran example, is unlocked, meaning that it is started running onfunctional clock FCLX.

Then in a stop feature, the analysis domain 1217 is scan programmable todirect the CPU domain to stop on a predetermined condition. When thepredetermined condition occurs, a signal ANASTP (Analysis Stop) is sentto the CPU domain 1213 to make it stop according to the stop modeestablished for it in mode register 1311 and mode conditioned stopcircuitry 1309C. DONE circuitry 1363 detects when the stop is completedand signals back to adapter (emulation mode control) 1203 to lock theCPU, for example, by putting it on test clock JCLK instead of functionalclock FCLK. The DONE signal is generated when all instructions in a CPUpipeline are executed and all currently pending memory access cycles arecompleted. Another definition of DONE may of course be used ormode-selected. Then using test clock JCLK, the important registers ofthe domains can be scanned out for recordkeeping, display and study athost computer 1101 of FIG. 45.

FIG. 58 illustrates in even further detail an example of process stepsby which the scan control 1149 including IR 1153, adapter 1203 includingECR (emulation control register) 1251, and host computer 1101 cooperateto enter and perform sequences of commands on-chip.

Operations in FIG. 58 commence in a step 1321 with a reset STRAP stateof FIG. 50A in the scan control 1149 in FIG. 50. Output JSTRAP of TAPcontroller 1151 of FIG. 50 becomes active and in a step 1322 sets twoJMODE bits in ECR 1251 of FIGS. 54 and 59. Adapter 1203 jams afunctional 111 command code and sets the domain clocks in a step 1323.

Next in a step 1324, the host 1101 sends TMS signals to scan control1149 to reach the FIG. 50A TAP controller state "Select-IR-Scan" andthen scans ECR select into the IR 1153. Further in step 1324 the hostsends more TMS signals to the TAP controller to reach the state"Select-DR-Scan". This means that the scan controller is ready to acceptscan into a DR (data register) identified just before as the ECR 1251 bythe host to the IR 1153. Into ECR 1251 the host 1101 then scans two-bitportions C0,CX of the triplets for RUN and HALT of Table III. Lock bitsare also loaded to unlock all of the domains. The lock bits are scannedfor this purpose into a FIG. 59 ECR 1251 portion called LOCK 1351.

In a succeeding step 1325, host computer 1101 sends TMS signals to thescan control 1149 to reach the TAP controller state "Select-IR-Scan"again. This time the host then scans MPSD path 1252 select into the IR.In a step 1326, more host TMS signals are sent to reach the state IDLEin FIG. 50A. Hardware in FIG. 50 thereupon produces the signal START toactivate the code state machine 1381 in the adapter 1203. A decisionstep 1327 determines whether the scan interface 1149, 1203 is ready.When ready, the host 1101 scans an ECR select into the IR 1153 in a step1328, followed by more TMS to reach the IDLE state in a step 1329. Thisdeactivates the start signal and permits scan-out of domain informationby DR scan from the MPSD path 1252 in steps which are omitted forconciseness from FIG. 58.

When the interface is again ready in a step 1331 operations proceed to astep 1332 and a step 1333 to select and scan the ECR 1251 JMODE bitsJMODE1 and JMODE0 with logic 1 and logic zero respectively to enableconcurrent emulation. Then in a step 1334 the host 1101 sends TMSsignals to reach the IDLE state of FIG. 50A for lock. When the interfaceis ready after a step 1335, the host 1101 scans command and lock bitsinto ECR 1251 in a step 1336. Next in a step 1337, the host 1101 sendsTMS to select scan to the IR, scans a MPSD path select into the IR. Nextin a step 1338, the host 1101 sends more TMS to reach the IDLE state ofFIG. 50A whereupon hardware of FIG. 50 initiates the START signal to theadapter 1203 code state machine 1381. A step 1339 has the host waituntil the interface is ready, whereupon operations loop back to step1333 to have the host 1101 scan further commands into the ECR and thenstart the on-chip emulation circuitry to run the chip in real-time.

It is to be understood that the description of steps is by way ofexample only. Data and control information are scanned into and out ofthe domains on test clock JCLK, and the domains are independently andselectively started on functional clock FCLK and stopped, in extensivesequences to accomplish emulation, simulation and test functions with awide degree of flexibility as circumstances of the development,manufacturing and field environments dictate.

This remarkable capability of scanning in emulation data and retrievingit from each domain, and further of individually clocking the domainswith either the real time functional clock FCLK or a test clock JCLK ismediated by the emulation control 1203 in response to the host computer1101 and improved JTAG circuitry of FIG. 50. The emulation control 1203is illustrated in greater detail in FIG. 59.

In FIG. 59, serial scan bits enter the emulation control register ECR1251 which is subdivided into a shift register LOCK 1351 for holdingbits to lock and unlock domains, a first C0,CX control code shiftregister named CODA 1353, a second C0,CX control code shift registernamed CODB 1357, a shift register 1359 associated with event managercircuitry 1365, and a two-bit register JMODE 1360. These registers arecompactly illustrated in FIG. 59A. Thus, the serial scan enters on ascan line SIN, passes serially through the shift registers 1351, 1353,1357, 1359 and 1360 until all the shift registers are loaded. Any serialscan output is scanned out via serial line 1361 SOUT.

A set of selector logic circuits 1371, 1373 and 1375 of FIG. 59 supplysignals on lines as shown in FIG. 56 to the domains for the core 1213,system 1215 and analysis 1217. Also, individualized domain clock linesDCLK of FIG. 56 are supplied respectively with clock signals SCLK, ACLKand CCLK in FIG. 59.

A code state machine 1381 controls a two input MUX 1383. MUX 1383selects the C0,CX two-bit contents of shift register 1353 or 1357 andloads them into an enabled one of three flip flops 1393, 1395 and 1397.A lock control circuit 1401 operating under the control of lock shiftregister 1351 and code state machine 1381 sends lock signals to disableor enable each of the flip flops 1393, 1395 and 1397, depending on whichselected domain 1213, 1215 or 1217 is to be unlocked while other domainsare locked.

Each flip flop has three sections for C0, CX and a clock control signalDSCS-.

Three clock control signals, each independent of the others and alldesignated DSCS-, are supplied from the flip flops 1393, 1395 and 1397to respective clock control circuits 1411, 1413 and 1415 which providethe individualized domain clock outputs--core clock CCLK, analysis clockACLK and system clock SCLK.

Test codes from the TMS, TDI and TDO lines from host 1101 enter FIG. 59on three lines 1421 to selection logic 1371, 1373 and 1375. Commandcodes for each domain can be derived directly from the test codes online 1421, thus overriding the code state machine feature. This optionis selected by scanning JMODE register with "00" (both bits zero). Thus,the preferred embodiment is accommodates direct host control of thedomains, wherein the latter is the JMODE 00 option.

If a switch of any domain 1213, 1215, 1217 between JCLK and FCLK is inprogress under control of any of the clock controls 1411, 1413, 1415,then code state machine 1381 should be temporarily stopped. This isaccomplished by a disabling input low active SWINPROG- (Switch InProgress) which is fed from a logic network 1425 in response to theLOCKC, LOCKA and LOCKS inputs from lock control 1401 and from threeclock domain signals GCTDC, GCTDA and GCTDS. The latter three signalssignify Good Clock This Domain for each of the domains--Core, Analysisand System, respectively.

In FIG. 59, the control block 1203 functions are programmable and allowone to:

1) Apply MPSD codes from one of two preloaded registers, CODA 1353, andCODB 1357 as directed by a code state machine 1381;

2) Program state machine 1381 operations via REVT (Register Event)register 1359 to respond to stimuli including:

a) START from scan control 1149

b) DONE from CPU core 1213, 1363

3) Control the clock switching from FCLK to JCLK (with a code 00 in bothregisters 1353 and 1357) and vice versa for each domain, via LOCKregister 1351; and

4) Lock domains in their current state while operating with otherdomains.

The control block 1203 allows the following clocking options:

a) The orderly switch of the domain clock lines between JCLK and FCLKclock pulse sources.

b) Domain clock lines may be locked in the current state by lock bits ona scan data path.

e) The JTAG strap (reset) state or MPSD strap state cause the functionalclock to be selected.

d) Test mode selection allows the entire chip to be driven by JCLK.

This clocking selectability allows configuration of a fully synchronouschip for test, and the ability to scan any one or more of the domains,or the whole chip with data transfers being synchronous to the JCLK.

The operation of code state machine 1381 is now further described. Whenthe JTAG IR (Instruction Register 1153) is loaded with a scan pathselect command for path 1251, a line ECRSEL feeds a signal to statemachine 1381 whereupon the state machine 1381 enters a lock state. Thisallows the registers 1351, 1353 and 1357, the event manager register1359, and JMODE register 1360 to be changed without disturbing the MPSDcodes and clocks supplied from flip flops 1393, 1395, 1397 and selectioncircuits 1371, 1373 and 1375 to the domains 1215, 1213 and 1217. Lockregister LOCK 1351 holds bits which selectively cause the CPU, analysisand system domains 1213, 1217 and 1215 to be frozen in their currentconfiguration and state in response to MPSD command codes presentlyapplied to them from flip-flops 1393, 1395, 1397 and logic 1371, 1373and 1375.

The START signal for state machine 1381 of FIG. 59 is generated in thecircuit of FIG. 50 when a scan data path select signal is present andTAP controller 1151 reaches the JTAG IDLE state of FIG. 50A. The JTAGinterface of FIG. 50 becomes passive and the dynamic operations ofcircuit 1203 of FIG. 59 commence.

In FIG. 50 the START signal is generated as follows. A path decoder 1168connected to instruction decoder 1155 qualifies AND gate 1170 when itsOR gate 1172 signals that the MPSD scan data path 1252 of FIG. 54 orMPSD scan control path are selected. An IDLE line from TAP controller1151 is connected to another input of AND gate 1170. When the IDLE stateoccurs with gate 1170 qualified for path, AND gate 1170 signals ahandshake synchronizer 1169 to supply START to code state machine 1381of FIG. 59.

Handshake synchronizer 1169 is provided because emulation control 1203is operated on pulses of functional clock FCLK at times while the JTAGcircuitry operates on the test clock JCLK. Handshake synchronizer 1169includes two state machines to control the generation of the STARTsignal to the code state machine 1381. One state machine is in the JTAGenvironment of FIG. 50 and the other is in the MPSD control environmentof FIG. 59. In this way, the clock boundary is crossed.

The emulation control block 1203 of FIG. 59 serves to create MPSDcontrol codes for the MPSD domains 1213, 1215 and 1217 which perform thenecessary emulation, simulation and test functions. A generalprogrammable implementation is illustrated, although a fixed hard codedimplementation is also feasible. Moreover, a microcoded control ROM(CROM) implementation of the circuitry of FIGS. 50, 51, 57 and 59 is analternative embodiment contemplated in the practice of the invention.

The code state machine 1381 controls the generation of MPSD codesequences to the domains. The clock control circuits 1411, 1413, and1415 each include a state machine that controls the switching of theclocks of the domains between JCLK and FCLK in an orderly way beforeallowing a new MPSD code (C0, C1, CX) to be applied to the domains."State Machine" is used in the computer science sense of the phrase todenote any software or hardware based circuit that is represented by astate transition diagram that has at least two states. This statemachine approach minimizes the number of JTAG opcodes assigned toemulation functions as well as greatly simplifying the MPSD interface.

From one perspective, the Pause command code (C1,C0,CX=100) of Table IIIis a default state or "anchor" to which the other states relate. Thecode state machine and registers CODA and CODB operate with their C0,CXcontents to alter the Pause state to HALT (101), CNTRL (110) or FUNC(111) of Table III. When a scan into a domain is desired, the code statemachine 1381 is directed by host 1101 software to enter C0,CX=00 in bothCODA and CODB, and in this way a Pause (100) is applied to the device11.

From a clock switching point of view, a transition from HALT 101 toPause 100 causes a functional clock FCLK to JCLK test clock switch-over.The switch-over occurs in the Pause state applied to the domain inputsC1,C0,CX by the logic 1371, 1373 and 1375.

A transition from Pause 100 to any of FUNC 111, CNTRL 110 or HALT 101causes the interface to freeze in Pause 100 until all unlocked domainsswitch to functional clock FCLK and thereupon operate on FCLK. Thus allclock switching occurs with the 100 Pause code applied.

The host 1101 software is programmed to operate this interface, forexample, on the assumption that when the Pause (100) code is present onall unlocked domains, and it may now load the MPSD path select into theIR 1153 and then scan MPSD data or control bits into a selected domains.The logic 1371, 1373 and 1375 of FIG. 64 responds to the path select asdata control to set a ScanData (00x) or Scan Control (01x) MPSD commandcode for the domains.

A Scan Ready SCANRDY interface-ready bit can be set in IR 1153 for useby host 1101 software to signify that all domains unlocked have noswitch in progress and Pause 100 is applied to them, so that it is allright to scan data or control bits into the domains.

Since the logic 1371, 1373 and 1375 responds to the path selects whenscan codes 00x or 01x are needed, it should be apparent that the codestate machine 1381 and registers CODA and CODX job primarily involvesdelivering code bits C0,CX from among the group 00 Ready to Scan, 01Apply HALT, 10 Apply CNTRL and 11 Apply FUNC. Code bit C1 of Table IIIis a one (1) due to host 1101 software not attempting to scan while thestate machine is applying a code C0,CX of 01, 10 or 11. Thus, the MPSDcommand codes C1,C0,CX are respectively constructed--101 HALT, 110 CNTRLand 111 FUNC.

FIG. 60 shows a schematic diagram of code state machine 1381 and itsevent manager 1365. Code state machine 1381 includes two interconnectedSRLs 1451 and 1453 that sequence through a state transition diagram ofFIG. 61 that has three states--LOCK, CODEA and CODEB and transitions T1,T2, T3, T4 and T5 between the states. The respective outputs of the SRLs1451 and 1453 are regarded as the MSB and LSB (most, least significantbits) of a two bit digital signal. The MSB represents the LOCK state,and LSB high and low respectively represent the CODEA and CODEB states.Event manager 1365 signals to SRL 1453 that if the state machine is inthe CODEA state, then a transition to the CODEB state is requested.

A third SRL 1455 of FIG. 60 is connected between SRL 1451 and lockcontrol 1401 of FIGS. 59 and 63. An OR gate 1461 has inputs connected tothe output of SRL 1451 and to switch-in-progress signal SWINPROG fromlogic 1425 of FIG. 59. OR-gate 1461 has its output connected toseries-connected inverters 1463 and 1465. The inverters are connectedrespectively to CAPTURE and HOLD inputs of SRL 1453 to provide statetransition inputs related to the state of SRL 1451 and SWINPROG. OR-gate1461 itself supplies a control hold CNLHOLD output to circuit 1383 ofFIG. 59, to which circuit line LSB is also connected. Event manager 1365is connected to an input of SRL 1453.

A NAND gate 1471 supplies a SET input of SRL 1451 in response to twoinputs ECRSEL (emulation control register select) and START from FIG.50. An AND gate 1473 supplies a RESET input of SRL 1451 in response toMPSDSEL (MPSD data or control scan path select) and START.

Event manager 1365 includes a set of logic circuits connected to signalsCNTBRW, DONE, EMU1 and EMU0 and any other analysis, core status, orother signals which the skilled worker elects. Signal CNTBRW is counterborrow from analysis block circuitry discussed in FIG. 69. DONE signalscompletion of a stop as discussed in connection with FIG. 58. DONE issuitably provided to the state machine as the differentiated trailingedge of a CPU core signal that indicates the core is running, so thatjust when the core ceases running, the DONE signal is provided. PinsEMU1 and EMU0 carry signals of same designation originating internallyor externally of the chip for emulation signaling.

Shift register 1359 includes scannable register-event bits REVT3, REVT2,REVT1 and REVT0. REVT3 is a scanable bit inverted by an inverter 1483 tosignal a NAND gate 1481 (which operates as a low-active OR) that feedsSRL 1453. REVT2, REVT1 and REVT0 are control bits cause event manager1365 to selectively ignore or respond to signals CNTBRW, DONE, and EMU1respectively. For this purpose, respective NAND gates 1485, 1487 and1489 have their outputs connected to NAND gate 1481. One input apiece ofNAND gates 1485, 1487 and 1489 is connected to REVT2, REVT1 and REYT0respectively. A second input apiece of said NAND gates is connected toCNTBRW, DONE and EMU1. Additional NAND gates for EMUO and other signalsare readily providable, as are further event register cells in shiftregister 1359.

The circuitry of FIG. 60 is inventively configured in any appropriatemanner to implement the inventive methods and structures. For instancein this embodiment, generally speaking, the code state machine 1381locks the MPSD control code currently applied to the domains when theemulation control path ECR 1251 is selected by the instruction registerIR 1153 and a START pulse is generated. The code state machine 1381exits the lock state upon a START pulse and a MPSD scan path selectedand can apply one of two MPSD control codes at times responsive tooccurrence of a predetermined condition of CPU core or other eventpreprogrammed by REVT bits before returning to LOCK state. Also, thecode state machine, as shown in FIG. 61 can automatically alternatebetween the first and second control codes before returning to LOCKstate. While only two codes have been shown for illustration, it isapparent that any number of control codes can be scanned into orotherwise stored in corresponding shift registers analogous to 1353 and1357 of FIG. 59, and a code state machine can be provided to havecorresponding states for each of the codes with circuitry to implementtransitions between the states to apply all codes in programmablesequences depending on various operational conditions. Some pairs ofMPSD control codes that are of particular interest for automatic entryinto the domains are tabulated in Table IV:

                  TABLE IV                                                        ______________________________________                                        CODA       CODB     Operation Performed                                       ______________________________________                                        Run 10     Halt 01  a)     Execute program portion:                                                      Analysis domain determines                                                    when to stop; stop mode                                                       determines how to stop.FCLK                        Pause 00   Pause 00 b)     Module Setup: download from                                                   host memory to SRLs in scan                                                   control path of a domain to                                                   select and deselect modules                                                   for subsequent data scan;                                                     upload from domain scan                                                       control path to host. JCLK                                                    See NAND 1585 FIG. 64                              Halt 01    Pause 00 c)     Load machine image via scan                                                   in (b); then load CODA and                                                    CODB. Start with Halt                                                         applied, machine then                                                         signals DONE to advance                                                       state machine to select                                                       CODB; now scan in next                                                        sequence. Repeat for each                                                     word of memory, for                                                           example.                                           Pause 00   Pause 00        Download from host                                                            memory to SRLs in scan                                                        data path of a domain by b;                                                   upload from domain to host;                                                   Lock 1351 determines which                                                    domain is loaded. Loading                                                     Analysis domain determines                                                    when to stop in Run/Halt                                                      above. Uploading from ana-                                                    lysis retrieves PC trace                                                      stack. Loading Core                                                           establishes program point                                                     from which to begin Run.                                                      Uploading Core recovers                                                       CPU core state when halted.                                                   Loading/uploading System                                                      domain initializes/recovers                                                   System domain state.                                                          See NAND 1583, FIG. 64.                                                       and control path select.                           ______________________________________                                    

In the state transition diagram of FIG. 61, some exemplary Booleanequations for the transitions T1-T5 are as follows:

T1=LOCK & NOT SWINPROG & START & MPSDSEL

T2=CODEA & NOT SWINPROG & ((REVT1=1 & DONE)+((EMU1+EMU0) &REVT0=1)+(REVT2=1 & CNTBRW)+(REVT3=1))

T3=CODEB & ECRSEL & START

T4=CODEA & ECRSEL & START

T5=CODEB & NOT SWINPROG & START & MPSDSEL

The CPU provides a run signal (RUN) the trailing edge of which isdesignated DONE and used in the T2 equation.

SWINPROG is the indication that any of the clock domains are in themiddle of clock transition.

START is set on the second clock cycle of the entry into the IDLE statewith the device scan data or control path selected.

In words, the code state machine 1381 makes transition Ti in FIG. 61from the LOCK state to the CODEA state provided the state machine is inthe LOCK state, the START signal is present, MPSDSEL is present andthere is no clock switching in progress. Transition T2 from to CODEBstate occurs if the state machine is in CODEA state, there is no clockswitching in progress and the event manager 1365 so requests. TransitionT3 from CODEB to LOCK state occurs if the state machine is in CODEBstate, the host 1101 has loaded an ECR request into JTAG IR 1153, andSTART is present. Transition T4 from CODEA to LOCK state occurs if thestate machine is in CODEA state, the START signal is present, and thehost 1101 has loaded an ECR request into JTAG IR 1153. Transition T5from CODEB to CODEA state occurs if the state machine is in CODEB state,and there is no clock switching in progress, MPSDSEL is active and aSTART signal is present.

The three clock control circuits or clock switches 1411, 1413, 1415 workin tandem with the code state machine 1381 and circuits 1383, 1393,1395, 1397 and 1401. Each clock control circuit 1411-1415 of FIGS. 59and 65 supervises the transitions between clocks FCLK and JCLK asmandated by the MPSD codes in the CODA and CODB registers 1353 and 1357selected by the code state machine 1381. When the code state machine1381 points to a register CODA or CODB containing a different clocksource for that state, the clock switch 1411, 1413 or 1415 correspondingto the unlocked domain selected by LOCK register 1351 and lock control1401 locks the code of the old state by signaling NOT GCTD (Not GoodClock This Domain) to make SWINPROG active and synchronously switchesthe clocks. When the new clock pulses have been applied for at least oneclock cycle from the new clock source, the clock switch then signalsGCTD to release SWINPROG and allow circuits 1383 and a circuit pair suchas 1397 and 1371 to pass the new control C0,CX control code to theenabled domain as described in more detail next in connection with FIGS.62-65.

In FIG. 62, selecting circuit 1383 has two MUXes 1501 and 1503 forrespectively selecting the C0,CX control code from register CODA or CODBin response to signal LSB from the code state machine 1381 of FIG. 59.The C0,CX codes in register CODA are designated CODA0 and CODAX, and inregister CODB are CODB0 and CODBX. The selected code is held in a pairof SRLs 1507 for C0 and 1509 for CX in response to control hold signalCNLHOLD fed to respective CAPTURE and HOLD inputs via inverters 1511 and1512.

SRLs 1507 and 1509 thus latch in the new code CODB selected when statemachine 1381 makes the T2 transition to CODEB state. However, this newcode is not instantaneously sent to its intended domain. First it ischecked by a circuit 1514 to determine whether the code impliesfunctional clock FCLK or test clock JCLK for use therewith. In otherwords, the circuit advantageously determines by itself which clock isneeded, and does not require an optional bit that could be provided byuser to define a clock request. In this exemplary embodiment circuit1514 is an OR-gate that selects test clock JCLK when both C0 and CX arelow (MPSD code for Pause). (MPSD code bit C1 is held at one by NANDlogic 1563, 1573, 1581, 1583,1585 of FIG. 64). The clock request fromcircuit 1514 is held in SRL 1513 in response to CNLHOLD, and SRL 1513produces a clock select output nclksel to lock control 1401 and eachcircuit 1393, 1395 and 1397 of FIG. 59.

Circuits 1393, 1395 and 1397 (only 1397 shown in FIG. 62) identicallyinclude SRLs 1517, 1519 for MPSD command codes C0 and CX and an SRL 1523to hold a clock select signal. These circuits hold previously enteredMPSD commands and clock select information to control all of thedomains. When any given one domain is to be updated, the correspondingone of circuits 1393, 1395 or 1397 is updated while the other two ofthem retain their information. SRLs 1517, 1519, and 1523 each have aninput connected to a corresponding output of SRLs 1507, 1509 and 1513.Data from circuit 1383 is strobed into a selected one of circuits 1393,1395 or 1397 depending on which of them is unlocked by lock signalLOCKS, LOCKC or LOCKA. Moreover, it should be apparent that LOCK 1351can have bits to lock or unlock some or all the domains at once. Whenscan of more than one domain is desired, the bits are appropriately set,and host computer 1101 can update all domains concatenated by MUXes ofFIG. 55 at once.

Simply put, the C0,CX codes are delayed by a clock cycle to the domainsso that the clock information that is implicit in C1,C0,CX of Table IIIcan be examined and acted upon prior to the code being applied. Ifaction is necessary, then Switch In Progress SWINPROG inhibits the codefrom being applied to the domain until the clock is switched.

In FIG. 63 the lock control circuit 1401 includes three OR gates 1531,1533 and 1535 each having first inputs connected respectively to linesLOCKRQS, LOCKRQC and LOCKRQA from LOCK register 1351 of FIG. 59, andoutputs connected respectively to lines LOCKS, LOCKA and LOCKC of FIGS.59 and 62. These three OR gates each have second inputs connectedtogether to the output of an OR gate 1541. A first input of OR gate 1541is connected to the output of an AND gate 1543. A second input of ORgate 1541 is connected to the output of SRL 1455 of FIG. 60. The ANDgate 1543 has two inputs connected to SWINPROG and nclksel. In this way,LOCK register 1351 bits override any other signals when the bits callfor locking the domain (test clock JCLK only). However, if register 1351unlocks any one or more domains (calling for functional clock FCLK toeach such domain), each such domain can be locked internally by eitherthe delayed locking MSB output of SRL 1455 or a conjunction of switch inprogram SWINPROG and clock select nclksel high. Every unlocked domain islocked without need of further selection circuitry by having OR-gate1541 send locking request indiscriminately to all three OR-gates 1531,1533 and 1535.

In FIG. 64 identical circuits 1371, 1373 and 1375 (1371 being shown) arerespectively connected to circuits 1397, 1395 and 1393. For example, theoutput of SRL 1517 and the output of SRL 1519 of FIG. 62 are connectedby two lines 1398 to a first input each of NAND gates 1551 and 1553 ofcircuit 1371 of FIG. 64. Circuit 1371 supplies the MPSD three wirecontrol signals for the system domain (SC0, SC1, SCX) at the outputs ofthree NAND gates 1561, 1563 and 1565. The output of each NAND gate 1551and 1553 is connected to an input of NAND gate 1565 and 1561respectively. When JMODE=00, a code conversion logic block 1205 isactivated to convert three wire test codes on lines TMS, TDI and TDO ofFIGS. 50 and 59 and produce two active-low outputs TC0- and TCX- to aninput of each of NAND gates 1561 and 1565. This block 1205 is enabled bya low active OR 1571 supplied from the two bits of JMODE register 1360of FIG. 59. Code conversion logic block 1205 thus converts to MPSD codefrom any three-wire testability code scheme other than the MPSD codes ofTable III, and thus increases the flexibility and adaptability of thesystem.

When the JMODE1 or JMODE0 bit is high, code conversion is disabled.Instead, for example when JMODE1 bit is high, a second input of each ofNAND gates 1551 and 1553 is qualified. When both JMODE bits are high, aNAND gate 1573 supplies a low output indicative of STRAP state (allowsdevice to run, effectively disables emulation and testability features).This low output forces high outputs by all three NAND gates 1561, 1563and 1565 corresponding to the (111) MPSD control code 7 for functionalrun.

NAND gate 1563 has a further input connected to the output of a NANDgate 1581 that in turn has two inputs respectively connected to anoutput of each of two NAND gates 1583 and 1585. The output of NAND gate1585 is also connected to an input of NAND gate 1561. A LOCKS-low-activeline qualifies NAND gates 1583 and 1585 when the particular domain(system here) is to be unlocked (JCLK select). When the TAP 1151 of FIG.50 is in the JSDAT state of FIG. 50A for scan input, a line JSDAT fromthe TAP goes high in FIG. 64, qualifying both NAND gates 1583 and 1585.

The role of NAND gates 1583 and 1585 is to specially determine the firsttwo MPSD control codes C1 and C0 (SC1,SC0 for system domain) when thehost computer 1101 has sent TMS signals to put TAP in the data scanJSDAT state, thereby telling the circuits that the host 1101 wants toscan MPSD data in a first case or to scan MPSD control bits in a secondcase. In the first case is in state JSDATA and IR 1153 is already loadedby host 1101 with MPSD data select that selects the MPSD path 1252 ofFIG. 54. The system domain, in this operational example, happens to belocked, but must be unlocked to allow scan. In FIG. 64 line MPSDDATAgoes high and MPSD CONTROL is low since MPSD control SRLs are notdesired as the path for scan. NAND gate 1583 output goes low, forcingNAND gate 1581 output high. Since the TAP is not in the STRAP state,JSTRAP- is inactive high at NAND gate 1563 and SC1 goes low. All inputsof NAND gate 1561 are high, forcing SC0 low. SC1, SC0=0,0 defines theMPSD data scan command for this domain, which is precisely what isdesired.

In the second case, the host 1101 has loaded IR 1153 with the MPSDcontrol path select, so IR 1153 selects the MPSD path 1252 as in thefirst case. However, this time IR 1153 decode sets MPSD CONTROL lineactive in FIG. 64 and leaves MPSD DATA line low. The domain is locked,but must be unlocked to allow scan. Inspection of NAND gates 1583, 1585,1561, 1581 and 1563 shows that the code SC1,SC0=01 is produced. In thisway the desired MPSD control scan command is defined for the domain.

As thus described, MPSD scanning of CPU, analysis, and system domainsinvolves slaving these domains to the JTAG environment 1149 by providinga scan control or scan data code at the domain interface with the domainconnected to JCLK test clock.

In FIG. 65, identical clock control circuits 1411, 1413 and 1415 (1415being shown) include NAND gates 1601 and 1603 supplied with functionalclock FCLK and test clock JCLK. A NAND gate 1605 supplies domain clockoutput (e.g. SCLK for clock control 1415) has inputs connected to theoutput of NAND gates 1601 and 1603 respectively. NAND gates 1601, 1603and 1605 effectively act as a clock MUX (multiplexer) controlled byrespective second inputs 1607 and 1609.

Physically, on the chip 11 it is contemplated that clock lines 1611 and1613 and switching elements 1601,1603,1605 for functional clock FCLK andtest clock JCLK be separated or isolated from the rest of the adapter1203 of FIG. 59. In other words, FIG. 59 shows a diagrammatic andconceptual close relationship of clock control circuits 1411, 1413 and1415 to the rest of the adapter 1203, but as a matter of chip design, itis believed preferable to isolate the circuits physically on the chip.Control conductors from the part of the circuits 1411, 1413, and 1415 inthe adapter section of the chip would be routed over to the clockgenerator elsewhere on the chip to the physical switching elements toselect which of the two clocks is routed to each domain.

Advantageously, the clock control circuits 1411, 1413, and 1415 causepart or all of the device 11 to run in the functional mode, accuratelyexercising the device at real-time rate for the purposes that it isprogrammed to accomplish. On the other hand, scan is operation ofactually sending bits serially into and out of the machine to establishthe machine state, and recover an image of a subsequently changedmachine state. Scan clock JCLK is preferably used to enter and recoverthe serial data for an emulation host computer 1101. Put another way, itcan be important for the domains to accept a clock which can enter thebits in the domains at the rate which they are being sent to device 11.In this way complications of synchronizing functional clock with someexternal clock are eliminated.

Also, the circuitry can support bit-by-bit asynchronous transfers at alow scan rate. In the bit-by-bit approach, test clock JCLK is a lowerrate than FCLK functional clock. A one clock width pulse correspondingin width to a pulse of FCLK is then ANDed with the scan or substitutedfor it in FIG. 65A.

Further in FIG. 65, assume that lines 1607 and 1609 are high and lowrespectively to select functional clock FCLK, that the circuit hasstabilized in response to Domain Switch Clock Select DSCS- inactivehigh. Then SRL 1523 of FIG. 62 is caused to drive DSCS- active low toselect the test clock JCLK. The GCTD signal is immediately driven low bya network of three NAND gates 1621, 1623 and 1625. DSCS- is connected toan input of NAND gate 1621 and its complement via an inverter 1627 to aninput of NAND gate 1623. Second inputs of NAND gates 1621 and 1623 arerespectively connected to lines 1607 and 1609. The outputs of NAND gates1621 and 1623 are connected to respective inputs of NAND gate 1625 whichproduces GCTD output.

With DSCS- now active low, inverter 1627 produces a high that forces aNOR gate 1629 to produce an output low. This low propagates throughserially connected D flip flops 1631 and 1633 in two clock cycles offunctional clock FCLK, driving line 1607 low and shutting off FCLK fromthe domain. However, test clock JCLK is not yet supplied to the domain.The low on line 1607 now qualifies a NOR gate 1639 for JCLK selectionpurposes. Since DSCS- is active low, NOR gate 1639 output goes high.This high propagates through serially connected D flip flops 1641 and1643 in two clock cycles of test clock JCLK, driving line 1609 high andadmitting test clock JCLK to the domain via NAND gate 1605. The line1609 high simultaneously drives qualified NAND gate 1623 output low,forcing GCTD output high to signal Good Clock This Domain. Switchingfrom JCLK back to FCLK occurs by an analogously reverse process incircuit of FIG. 65.

Returning to general considerations, the development system capabilitiesare composed of ANALYSIS of bus traffic, inspection and modification ofthe machine state, execution of the user's program, observation ofPERIPHERAL operation, and reading and writing of the MEMORY. There is abasic set of capability provided by MPSD which is supplemented byadditional concurrent capability when the JTAG front end is added to thesystem.

In the preferred embodiment, a feature called Mode Driven Stops hereininvolves establishing one of six stop modes and then providing decodecircuitry so that in response to the selection of any of theseparticular modes, the particular type of stop is effectuated asdescribed hereinabove. Mode driven stops are a particularly advantageousimprovement because they allow for example, the development engineer toshut down a processor in one way when simulating peripherals and to stopthe processor in a different way when doing emulation braking. Forexample, in emulation braking, it may be desirable to stop the CPU, butnot stop the peripherals. An emulation counter preferably continuescounting so that the sample rate is correct on the target board 1043 ofFIG. 45, but it is desirable to stop the CPU so that information can bescanned out or parallel accessed between samples. On the other hand, inthe case of clock stepping it is desirable to stop all domains. Also inthe case of simulation of peripherals, it is desirable to stop alldomains because the peripheral is being simulated.

Thus, development system capability is implemented as a basic set offunctions available through the interface which stops the CPU core toaccess the Analysis, CORE, Peripheral, Memory, or Interface information.

A degree of execution concurrency is present when the system isprogrammed to halt the CPU core while the other parts of the system,Peripherals, Memory and Interfaces continue to operate.

In FIG. 57, the stop modes are specified at the beginning of anemulation session. They address the operational mode of the device forthe entire session. The operating mode is specified in a separateemulation mode register or module 1311 which is scan-loaded while theCPU core is halted. This advantageous mode feature involves mode drivenstops.

In other words, operating modes are defined primarily by thecharacteristics the chip exhibits when the device halts execution. Theseoperational modes are herein called Pipe Flush, Pipe Step, and ClockStep. Trap enable maps analysis stops to traps and enables emulationtrap opcodes.

In pipe flush, the CPU block halts when a stop condition is detected.The CPU ceases instruction fetches, executes all instructions currentlyin the pipeline, and completes all memory activity in progress prior tosignaling DONE to code state machine 1381 of FIG. 57 and signaling thestop condition for scan purposes on line SCOUT. All other blockscontinue to run, and all control lines from the CPU core associated withcommunications with the peripherals or memory are maintained in aninactive state once the pipeline is flushed when the chip is inemulation mode. In simulation mode peripherals stop with CPU.

In pipe step, the CPU block is the only block that halts when a stopcondition is detected. The CPU freezes on a pipeline clock boundary, thepipeline freezes, and all external memory accesses appear to completesuccessfully whence DONE is supplied. All external memory control linesgo to an inactive state. The address lines are still valid when writeenable WE- and Read/Write R/W- go high. If the CPU is started in thismode and an external memory access is determined to have been inprogress when the device was stopped, the access is restarted to theexternal world when execution begins. All control lines associated withcommunications with the peripherals or memory are reset inactive.

Clock Step steps the device one clock cycle; memory signals stay ifmulticycle. The CPU traps to a predetermined location as an NMI(nonmaskable interrupt) when an analysis stop condition is detected.Code execution continues and all subsequent program generated stopconditions are disabled until a return from emulation trap instructionis executed. All other domains continue to execute. The word trapdenotes a hard call of a subroutine that is handled by the processor.The jump address is not set up by the software being executed, butinstead is set within the processor itself. An alternate mechanism is anemulation trap instruction. In a development-type operation, a specificinstruction can be replaced with the trap instruction, which is called asoftware breakpoint for this purpose. If the software is in RAM, asoftware breakpoint can be used. When the software is in ROM, a hardwarebreakpoint is provided herein to overcome the problem that aninstruction in ROM code would not be replaced dynamically.

In simulation pipe flush, the entire chip halts when a stop condition isdetected. The CPU ceases instruction fetches, executes all instructionscurrently in the pipeline, and completes all memory activity tied toinstructions currently in the pipeline, prior to signaling DONE to codestate machine 1381 of FIG. 57 and signaling the stop condition for scanpurposes on SCOUT. All other blocks stop when the CPU stops.

In simulation freeze, the entire chip stops immediately and signals DONEwhen a stop condition is detected. All external control lines go to aninactive state.

In simulation trap, the CPU traps to a predetermined location as an NMIwhen an analysis stop condition is detected; otherwise a stop occurs.Code execution continues and all subsequent program generated stopconditions are disabled until a return from emulation trap instructionis executed. Peripherals are suspended during a time period from thetime the trap is taken to the return from emulation trap instruction.

The particular stop mode of the processor is determined by mode register1311 of FIG. 57, as already discussed. The location, placement in anyparticular register, and scanability of each of the bits of the stopmode is quite flexible. In another example, the particular stop mode canalso be implemented using five control bits TEST, SIM, EMU, TRAPEN andPFLUSH. The just-mentioned bits resides in the analysis domain in thisembodiment. If the stop mode is generally not changed frequently inpractice, then it can be put in a separate mode register 1311 to avoidunnecessary scan bits in the various domains. Otherwise, the variousstop mode bits can be allocated to domains as described in the secondexample.

    ______________________________________                                                   TEST      SIM    PFLSH                                             ______________________________________                                        EMU Freeze   0           0      0                                             EMU Pipe Flush                                                                             0           0      1                                             EMU Trap     0           0      0                                             SIM Freeze   0           1      0                                             SIM Pipe Flush                                                                             0           1      1                                             SIM Trap     0           1      0                                             TEST Freeze  1           0      X                                             ______________________________________                                    

There are subtle differences between the emulation and simulationfunctions and they are outlined below: Generally speaking, a keydifference between Emulation and Simulation stopping modes is that withemulation, the peripheral logic remains active to the extent possiblewith the CPU core stopped. In the simulation modes, the peripheral logicis also stopped.

Pipe Step stops the CPU on pipe-stage boundaries. Emulation andSimulation differences are determined by what domains are directed torespond to the MPSD port. In Emulation mode, only the CPU domain isconnected while in Simulation mode all domains are connected. Since theperipherals and interface domains continue to run in the emulation mode,memory cycles complete and peripherals continue to run. Simulation modehas all domains operating together, resulting in the CPU, peripherals,and interfaces freezing simultaneously.

Pipe Flush--Pipe flush stops the CPU on instruction boundaries. Bothsimulation and emulation modes require the CPU core to complete allinstructions fetched, and clear the pipeline of activity prior toexecuting the required freeze sequence as described above. In emulationmode peripherals continue to run if directed locally to do so. Insimulation mode, peripherals stop.

Trap--Trap does not stop the CPU but instead takes a trap. Emulation andsimulation trap differ in that simulation trap causes the peripheraldomain to stop when the trap is taken until the emulation trap return isexecuted.

The CPU core generates a signal called SUSPEND which indicates to theremainder of the device that the CPU has halted the execution of theuser program. The behavior of the SUSPEND signal in each of theoperating modes is shown below:

EMU Freeze--Asserted immediately when CPU stops.

EMU Pipe Flush--Asserted immediately when CPU stops.

EMU Trap--Asserted when CPU traps for emulation or CPU steps per modespecification or opcode execution.

SIM Freeze--Asserted Immediately when CPU stops.

SIM Pipe Flush--Asserted Immediately when CPU halts.

SIX Trap--Asserted immediately when CPU takes trap. Deasserted withexecution of Emtrap return.

In a Suspend Interlock function, the CPU has a scanable bit which causesthe SUSPEND signal to be asserted to the remainder of the chip. When theCPU stops, SUSPEND is asserted by core hardware until the CPU isrestarted. Since the CPU is asked to run during memory operations, ascanable interlock bit (SUSILOCK) is in the CPU so that SUSPEND can bemade to remain active upon software command. In this way SUSILOCK allowsthe CPU to execute scan initiated memory operations. This bit isinitialized to the not suspend (inactive condition) by the JTAG strapstate of FIG. 50A. The SUSPEND signal broadcast to the chip is thelogical OR of the CPU stopped signal and the SUSILOCK bit. The presenceof this bit facilitates the use of macros and other program sequencessuch as fills, finds, or download assists.

The core is used to gain access to memory and peripheral resources.Memory operations are suitably generated using CPU resources. Memoryaccesses are generated by scanning in a CPU state including appropriateCPU memory access instructions, which causes memory accesses to begenerated to the appropriate memory or I/O space. This is accomplishedby loading a machine state with the pipe flush bit set, and appropriateinstructions in the pipeline to cause the desired memory operation.

Before any memory activity is initiated, the SUSPEND bit is set in theCPU image to prevent the remainder of the system from detecting that theCPU enters the execution mode for a short period.

When the state has been loaded, the CPU is taken from a MPSD pause stateto a halt state. The CPU then executes the loaded instruction as thoughit is finishing a normal halt sequence, setting SCOUT to indicate thatan execute is in progress and then signaling DONE on SCOUT when the pipeis empty and all memory operations generated by the instruction arecompleted. Memory activity beyond that initiated by the instructionscanned into the pipeline does not occur. When the operation is over,the machine appears as if it has completed a normal halt sequence whenthe halt code is applied from the MPSD port, with the pipe flush bit on.

Multiple memory operations, such as memory dump or file, utilize macrooperations. The repeat operations are scanable to set up a singleinstruction scan load with the repeat operation already established. Itis therefore not necessary to load both the repeat and executableinstruction via the scan.

In any stop mode the analysis domain continues to function.

Instruction sequences and resource to be used to be for memory and I/Ooperations are: Program Memory Read, Program Memory Write, Data MemoryRead, Data Memory Write, I/O Read, I/O Write.

In order to facilitate fast memory downloads, the preferred embodimentadvantageously includes a CPU scan path which minimizes the number ofbits transferred to initiate a memory or I/O transaction, especiallywhen the memory transfer is a single word. When the entire register filemay be used to create a block transfer, multiple scan modules may beused.

The short scanpath includes all the CPU resources necessary to implementthe above mentioned type of memory operations. The repeat instructionand the autoincrementing characteristics of the auxiliary registers aresuitably used to create efficient load sequences.

When cache is part of the architecture, it is easily loadable andunloadable via scan operations. This allows the cache to be set up withmacros which terminate with software breakpoint instructions. Theprogram counter and cache management hardware are set up to assure thatprogram execution will take place out of cache, the SUSPEND bit is set,and execution is initiated. This allows fast memory transfers, fills,finds and other Macros to be implemented.

The advantage of the cache macro method is the ability to effectivelycreate a hidden program memory which cannot be accessed as the result ofinstructions.

Advantageously, the preferred embodiment confers a level of concurrencybeyond mere JTAG boundary scan. Microprocessors, for one example, are avery valuable and complex application with access to the internalinformation very important. Since JTAG boundary scan involves a testport, this test port is even more effectively utilized for communicationto specific chips one at a time or all together, concurrently. Thepreferred embodiment puts commands in emulation control register 1251and loosely couples the communication so that the device 11 can run inreal time when desired. In this way a merely static test environment isimproved to provide dynamic operation of device 11 in response to thecommands such as CODA and CODB in FIG. 59, in contrast to loading theJTAG IR 1153 and executing an operation by decode.

Instead of directing the chip clock cycle by clock cycle, the preferredembodiment sets up a condition in the analysis domain, and then theanalysis domain effectively monitors the chip as it runs in real time,then detects when the condition occurs, stops the chip and notifies theemulation host computer 1101 that the chip is stopped. In effect, thepreferred embodiment of FIG. 59 acts as an emulation speed step-uptransformer by reducing the number of commands required of the emulatorhost by freeing the emulator host from clock cycle-by-clock-cyclesupervision and accommodates modern chips that run at clock rates thatfar outstrip the speed of the emulation host computer. Moreover, thepreferred embodiment is upwardly compatible with cycle-by-cycle control,since the wires of the scan interface can be used to generate MPSDcommand codes by the conversion block or translator 1205 in the STRAPstate of FIG. 50A, for instance.

The preferred embodiment has further uses in simulation acceleration andother device debug operations. The device is run on functional clockFCLK and then stopped and a device state is recovered, observed andstudied. The JTAG testability interface is thus used to input stimulivia scan and achieve simulation rates on the order of even 10,000instructions per second which are state-wise accurate. Prototype siliconpatterns are readily debugged off line without investment in testerapparatus that may exceed six figures in magnitude of cost. Whereas JTAGboundary scan suggests to the art to reach out to the board, the presentembodiment reaches into the bowels of each device on the board as well.Device debug is accelerated because every internal scan state is rapidlyproduced and recovered.

Accordingly, the capability of now downloading functional code throughan emulation system has important implications for the field of test aswell. Now the user can do self test. In self test according a preferredmethod, the user has a random access memory (RAM) in the device 11 oraccessible to the device 11. The user downloads an extensive testprogram through the emulation port that is the equivalent of BIST (BuiltIn Self Test). No dedicated device hardware is thus required for BIST,since the emulation hardware on chip advantageously accommodates thisadditional use without further investment. The user can download testsusing emulation functions, and can run the same test patterns in serialsequence as the user would when doing a go/no-go device test on amanufacturing production line.

Moreover, as illustrated in FIG. 66, tests are downloaded in the chipmanufacturing process itself. The host computer 1101 is advantageouslycoupled to a test head 1651 of a wafer fabrication line 1653 to detectdevice defects on each wafer 1655 before the wafer is divided into chipsor at any point in manufacturing. A scan interface as described inconnection with FIGS. 49, 54, 55, 56, 57 and 59-65 is microscopicallyprovided in each of numerous locations 1657 on the wafer from which manychips are derived respectively.

The host computer 1101 in FIG. 66 is loaded with a testing program andcommunicates via controller card 1141 and serial line 1103 to a wafertest head 1651. Test head 1661 is precisely positioned in X,Y,Zcoordinates 1663 to reliably press contact wires 1665 againstmicroscopic contact pads for each die location 1657 in the wafer 1655.The circuit at location 1657 is the circuit of device 11 for example. Afull complement of peripheral resources is available to computer 1101and device on the wafer, in the form of printer 1143, hard disk 1145,and modem 1147 on bus 1148.

According to a process illustrated in FIG. 67 operations start withwafer fabrication 1671 and then in a step 1673 the wafer 1655 isconveyed to the test position shown in FIG. 66. Then a step 1675positions test head 1651 in XYZ coordinates 1663 to contact the nextchip on the wafer 1655 with test head 1651. A succeeding step 1677downloads scan-self-test patterns to RAM in the chip via test head 1651.The chip is switched to functional clock to execute the test patternson-chip in step 1679. Then the device state of the chip is scanned outthrough the microscopic interface having circuits 1150 and 1203 of FIG.49 at location 1657 in step 1681. The signals pass through test head1651 to host computer 1101 for processing and data storage and displayin the peripheral resources. In step 1683, host computer 1101 determineswhether the chip at location 1657 is defective. If defective, a step1685 branches to an action step 1687 to optionally dot-mark the waferlocation and/or to store data on it to keep a record of the defect whichmay also be useful for microscopic repairs of the circuit. Then in astep 1689, if all chip locations are not yet tested, operations loopback to step 1675 to precisely position the contacts 1665 of test head1651 against the next chip location to be tested on wafer 1655. If alllocations are tested, operations branch from step 1689 to a decisionstep 1691. If a next wafer is to be tested, operations loop back to step1673 to convey another wafer to test position, otherwise the processcomes to END 1693.

In device 11, the core CPU implements the following capabilities:

Strap functional when directed from the scan interface.

Run and halt when directed from the scan interface.

Halt when either a software breakpoint or a hardware breakpoint isencountered.

Select the core clock to be a scan clock and prepare to scan.

Assert a suspend signal to the remainder of the chip in order to directperipheral start/stop features.

Keep a clear record to indicate the reason that the device halted.

Manage interrupt occurrences.

Provide pipeline management for breakpoint and software interruptoccurrences when they interact with delayed branches and otherpipeline-relevant occurrences.

Instruction step such as executing the interrupt service routine oneinstruction at a time if an interrupt occurs.

Generate memory accesses from CPU core while the core is halted.

Program counter stack traces a number of preceding programdiscontinuities.

Read and write to memory while the CPU core is executing code;communicating with a debug monitor or SPOX debugger resident on the chipor in memory.

FIGS. 68A and 68B show a block diagram of functional circuitry of CPUcore domain 1213 which is improved with a series of scan registersindicated as small squares fed from input CSCIN. The CPU core was mostlydescribed in connection with corresponding FIGS. 1A and 1B of the U.S.Pat. No. 5,072,418 incorporated by reference hereinabove. The detail ofthe organization of the scan registers and the associated MPSD modulecircuits for several modules is suppressed for clarity in FIGS. 68A and68B.

CPU core is further improved by providing a trace stack circuit 1695distinct from program counter stack 91. Unlike stack 91, trace stackcircuit 1695 develops a history of program counter discontinuities andproduces a TRFUL trace stack full signal when it is filled to capacity.

A hardware breakpoint circuit 1697 is connected to program address bus101A and produces a program address break point signal BPPA when aparticular program address or address in a predetermined range ofprogram addresses is encountered.

In FIG. 68B, a hardware breakpoint circuit 1699 is connected to dataaddress bus 111A and produces a data address break point signal BPDAwhen a particular data address or address in in a predetermined range ofdata addresses is encountered.

For scan purposes, trace stack 1695, and breakpoint circuits 1697 and1699 are on the separate scan path for the analysis domain 1217. Thecore however is on the scan path for core domain 1213.

FIG. 69 shows circuitry in the analysis domain 1217 of FIGS. 51-53 and55-57 which produces a breakpoint signal ANASTP for analysis stop of thecore according to the appropriate mode selected. Circuit 1217 includeson-chip circuits for providing signals representative of particularprocessor conditions. These signals are designated IAQ, CALL, RET, INT,BPPA, BPPDA, and TRFUL. Each of these sensed signals is provided torespective selection circuits 1703 shown as AND gates. The outputs ofcircuits 1703 are delivered to a combining circuit 1705 shown as an OR-gate 1705, the output of which is ANASTP, the breakpoint signal.Selection circuits 1703 act under the control of stored bits that areloaded via the analysis domain 1217 part of scan path 1252 as shown inFIGS. 54 and 55.

Thus, the bits which are scanned in are loaded into a 12 bit register1707, 3 bit register 1709 and single bit registers 1711.1 through 1711.8in this section of the analysis domain 1217.

The contents of each of the registers 1711.1 through 1711.8 qualify ordisable a corresponding one of the selection circuits 1703 so that theoverall device 11 condition which can trigger a ANASTP breakpoint signalis completely defined.

Line IAQ is activated when there is instruction acquisition by pipelinecontroller 225 of FIG. 68A. This way of initiating a stop facilitatessingle step operations, even in ROM resident code. Any cycle in which aninstruction is read from program memory is an instruction acquisition.In the pipeline of this embodiment, instruction fetch is the first offour pipeline steps in incorporated FIG. 29, and when fetch occurs, lineIAQ is activated.

CALL is activated upon a subroutine call. RET becomes active upon areturn from subroutine. If desired therefore, the analysis domain can bescanably programmed to start the device at the beginning of a subroutineand then automatically stop when the subroutine return is reached.Conversely, the device can be scan loaded to start to begin somewhere ina main routine, run at full speed and then automatically stop when asubroutine call is encountered.

INT goes active in response to an interrupt occurrence. When a stop isprogrammed to occur upon interrupt occurrence, the stop suitablyexecutes on any machine vectored program counter load except theemulator trap. Interrupts that occur while the CPU is stopped arelatched but are not executed until the CPU is restarted. When the CPU isrestarted it executes the currently addressed instruction beforeallowing a trap to the interrupt vector. When code is beingsingle-stepped, the code takes the interrupt trap as soon as thepipeline is flushed, as it would in real time.

BPPA is a line responsive to a program address breakpoint circuit. BPDAline is responsive to a data address breakpoint circuit. An example ofuse of the BPDA data address breakpoint involves a debug problem inwhich the processor is running correctly most of the time, but aparticular address occasionally gets garbage values. By inserting abreakpoint at the affected address, the user stops the processor at theinstruction that wrote to that address, scans the instruction out of thestopped processor to host computer 1101 and inspects the state of theprocessor to determine how to fix the bug. In this manner, systemdebugging is much more efficient of time and system resources.

Another way of determining system state at the instant a particularaddress is accessed might be to replace the contents of that addresswith a trap instruction. This instruction is called a softwarebreakpoint, and the insertion is a development-type of operation. A trapis a hard call of a subroutine that is handled by the processor. Thesubroutine is programmed to dump the device status so that the user candebug it. However, when the software to be debugged is in ROM, it isimpossible to enter the trap instruction in the ROM, since the ROM isread-only by definition. Advantageously, the hardware breakpointapproach is not only applicable to debug in RAM as is softwarebreakpoint, but also in ROM.

A MUX 1713 has eight inputs, and seven of the inputs are respectivelyconnected to lines IAQ, CALL, RET, INT, BPPA, BPDA and TRFUL. The eighthline is connected to a clock line FCLK for functional clock. The clockline can be selected for single-stepping or execution for any selectednumber of clock cycles whereupon the processor stops.

The three bits in shift register 1709 make a one of eight selection byMUX 1713 and supply the selected line to a 12 bit down counter 1715. Apredetermined count is loaded into the J (jam) parallel input of counter1715 from 12 bit shift register 1707. As signals on the line selected byMUX 1713 occur, the 12 bit down counter counts down until the numberrepresented by the contents of shift register 1707 is exhausted,whereupon a borrow line 1717 goes active and is fed to selector 1703.1.The borrow line signal is called CNTBRW for purposes of event manager1365 of FIG. 60.

The output of selector 1703.1 is not only connected to an input of thecombining circuit 1705 for supplying ANASTP, but also is connecteddirectly to an output pin EMU0. EMUO is advantageously connected toexternal counter 1719 which communicates with host 1101.

In this way, the on-chip condition sensor includes a counter selectivelyconnectable to sensor circuits. A logic network is connected to thesensor circuits and a serial scan circuit with SRLs is interconnectedwith the logic network for determining selections of sensor circuits bythe logic network. The serial scan circuit is further interconnectedwith the counter for loading the counter with the value indicative of apredetermined count to which the condition sensor is thereby madesensitive. The condition sensor further includes a plurality of sensorcircuits responsive to particular internal conditions of the electronicprocessor and a multiplexer 1713 having inputs connected to the sensorcircuits and an output connected to the counter.

An example of the utility of the down counter 1715 (besidessingle-stepping) is as follows. Assume that the counter 1715 is set byscan register 1707 to 200 and the MUX 1713 is set by register 1709 toselect BPDA data address breakpoint. The particular data address isscan-entered in a register 1813 in FIG. 71. This configuration stops theprocessor after the specific scan-identified data address has beenaddressed 200 times.

This exemplary use of address breakpoint counting is valuable indesigning a digital filter that does not stabilize until it hasprocessed a certain number of signal samples so that its taps arefilled. For instance the response of an FIR filter may not be measurableuntil the number of samples required to fill all the multiply-accumulatefilter taps are present. The output of the filter which is of interestin evaluating whether the filter operation is correct thus begins whenthe signal has traversed the filter. In one type of 16 tap FIR filter itis desirable to stop only after sixteen events and every other timeafter that to examine the output of the filter.

Advantageously, the analysis circuitry cooperates with the host computer1101 for emulation, simulation and test of digital filters as justdescribed.

In another filter example, the counter borrow line is selected by scanregister 1711.1 and fed out of pin EMU0 to permit external logic tocount events at a rate stepped down by frequency division by the valuein the downcounter 1715. Timing analysis of an algorithm may consume onthe order of five billion cycles, wherein timing analysis determines thenumber of cycles needed to execute the algorithm. (If the counter ismade scanable and extended to the appropriate number of bits, thisfunction is advantageously executed entirely on-chip.) A particularfilter design may require at least a certain sample rate to meet theperformance criteria specified for the filter. The maximum number ofinstructions available to achieve that sample rate is related to thesample rate and the computer clock rate. The present circuit permitsaccurate counting of the number of clock cycles consumed by the filterto perform the algorithm, so that the algorithm can be developed to meetthe specifications of the filter.

When external logic is used, its resolution is equal to the number setfor the counter 1715 by register 1707. Full resolution is obtained byreading out the value in the 12 bit down counter, allowing determinationof the exact cycle count of an algorithm between two break events,further illustrating the advantages of this preferred embodiment. Directcounting of break events and/or clock cycles by counter 1715 on chip isfurther advantageous because available external counting logic may betoo slow to keep up with the new processors to monitor them.

A break event herein is a condition that causes the processor to stop orto affect counter 1715. The event detection in one exemplary processoris split between the CPU and Analysis domains. Together, the two domainsprovide nine different events, all of which can be programmed to causethe processor to stop. The events and their respective domains are shownbelow:

    ______________________________________                                                                Comes From:                                           ______________________________________                                        1.   Software Interrupt (SWI) CPU                                             2.   Instruction Acquisition (IAQ)                                                                          CPU                                             3.   Subroutine Call (CALL)   CPU                                             4.   Subroutine Return (RET)  CPU                                             5.   Interrupt/Trap (INT)     CPU                                             6.   Clocks (CLK)             CPU                                             7.   Breakpoint Program Memory Address (BPPMA)                                                              ANA                                             8.   Breakpoint Data Address (BPDMA)                                                                        ANA                                             9.   Trace Buffer Full (TBF)  ANA                                             10.  Item Counter Borrow (ICB)                                                                              ANA                                             ______________________________________                                    

All events are enabled, detected and latched in the analysis domain asdiscussed in connection with FIG. 69.

The CPU core should not process local or analysis inputs once a stopcondition has been processed. This includes the time from when anemulation trap occurs to when the emulation trap return is executed.

The core responds to the consolidated stop signals of:

CPULSTP--Core local stop stimulus

ANASTP--Analysis stop

SWBP--Software breakpoint detect

HALT--MPSD halt code

When the halt is detected, LSTPCND (Latch stop condition) is asserted tothe CORE and Analysis blocks. It is desirable that the CPU stopindications be read from the analysis domain when the analysis domaininformation is current. This is due to the Emulation Trap mode in whichthe core domain continues to run while the analysis domain is halted.

Functional reset is gated off when the halts occur due to emulation stopmechanism. It is contemplated that the reset logic (not shown) fordevice 11 assure that any reset input entering the device past thegating function is stretched to sufficient length so as to correctlycomplete the reset function. When reset occurs simultaneous to a stopcondition the reset is completed and the device stops when the reset iscompleted and the interrupt trap vector has been fetched.

The processing of interrupts by device 11 should mesh with emulationrun/halt operations implemented by CODA and CODB in adapter 1203. Whenexecuting an instruction or clock step, interrupts are serviced whenenabled. This assures that single instruction stepping through code willallow the processing of interrupts.

FIGS. 69 and 45 and the description herein thus illustrate an electronicsystem that has a data processing device including a semiconductor chipand an electronic processor on the chip. Host computer circuitryoff-chip is connected to the data processing device. The host computer(e.g. computer 1101) has a speed of operation which is slower than theelectronic processor. The data processing device 11 further has anon-chip hardware breakpoint address circuit, trace stack, pipelinecontroller condition sensing circuits and other on-chip conditionsensors including the counter 1715 for signaling the processor in realtime, as well as signaling to the slower host computer. The adapter 1203acts as a step-up transformer of control speed between slower host 1101and state-of-the-art speed of device 11. The analysis circuitry alsomediates the real-time control function as well as provides a step-downtransformation of data via the counter 1715 to the slower externalenvironment. It is emphasized that the circuitry of FIG. 69 is but oneexample, and numerous variation can be provided by the skilled workeraccording to the principles set forth herein to provide sensor logic forany logical combination of conditions so that occurrences of any complexcombination of conditions or sequence of conditions can be sensed. Thebreakpoint signal can be a stop signal ANASTP as illustrated or anyother control signal besides a stop signal that should be responsive tosensed target device electrical conditions.

In FIG. 70, a method of operating the analysis circuitry of FIG. 69commences with a START 1721 and proceeds to a step 1725 to senseinstruction acquisition. Step 1727 senses a subroutine call, and a step1729 senses a Return. In step 1731, an interrupt condition is sensed.step 1733 senses a breakpoint program address, and step 1735 senses abreakpoint data address. In step 1737, a trace stack full condition issensed. Then a step 1739 selects which conditions are relevant usingshift register 1711 and logic 1703 of FIG. 69 for example. Of theconditions selected, a count is kept in step 1741. A decision step 1743determines whether the count exceeds a predetermined count N and if so,a signal of the count N being reached is output in a step 1745.Operations proceed from either step 1743 or 1745 to a step 1747 whichprovides an output to the external processing equipment at a slower ratethan the rate of operation of the device 11. In step 1749, this outputis coupled to a host computer whereupon operations return to START 1721to repeat the steps indefinitely.

In FIG. 71, a circuit for breakpoint sensor 1697 of FIG. 68A suppliesthe signal BPPA for analysis circuitry of FIG. 69. The circuit issuitably replicated for breakpoint sensor 1699 of FIG. 68B and connectedas shown therein for producing the signal BPDA.

In FIG. 71, program address bus 101A of FIG. 68A is connected to adigital comparator 1811. A reference value is scan-loaded into a furtherregister 1813 in the analysis domain having most significant bits MSBand least significant bits LSB. When a program address asserted onaddress bus 101A is identical to the contents of register 1813, thencomparator 1811 produces an output indicative of a breakpoint addressoccurrence on line BPPA.

In a further advantageous feature of the breakpoint circuit, abreakpoint may be taken on any address within a selected group ofaddresses such as the ranp, indicated by the most significant bits MSBof register 1813. In such case, a scanable mask register LSBEN isscan-loaded to disable the response of comparator 1811 to the LSB bitsof register 1813. Only the most significant bits are compared bycomparator 1811 in this mask condition, thereby providing a breakpointon occurrence of a program address in a particular range of addresses.

Scanable register 1813 for breakpoint purposes requires no connection todata bus 111D. However, this register 1813 is advantageously reused formessage passing access between the emulation/simulation/test hostcomputer 1101 of FIG. 45 and the data bus 111D of the target device. Themessage passing function is used when breakpoint sensing need not occur,and vice-versa, so that register 1813 feasibly performs differentfunctions at different times.

In FIG. 72, a special program counter trace stack circuit 1821 inanalysis domain 1217 holds a predetermined number of addresses defininga history of address discontinuities in operation of program counter ofFIG. 68A in the CPU core domain. A scanable trace stack register section1823 responds to control circuit 221 to push a program counter 93address value onto the trace stack when a program counter discontinuityoccurs. A leading bit S/E1, . . . S/E9 of each level PC0, PC1, . . . PC9of stack 1823 stores a state vector representing whether a value PC0, .. . PC9 is a beginning or ending address of a discontinuity.

For example, in FIG. 74, a program memory space has addresses A1, A2 andA3 indicative of addresses in a main routine from which interrupts aretaken. An interrupt routine begins at an address I1 and ends at anaddress IN. Returning to FIG. 72, an example of a history ofdiscontinuities is entered as addresses at right on the stack levels PC9. . . PC0. This history indicates at level PC9 that an interruptoccurred at when a main routine was executing at address A1. Then, justabove entry A1 in PC9, there is an entry I1 indicating the beginningaddress of the interrupt routine of FIG. 74 entered in stack level PC8.Thus, the entry in PC9 is a beginning address of a discontinuity and thestate vector bits S/E9 and S/E8 have opposite logic levels. For example,a one bit in S/E9 indicates a beginning of a discontinuity. I1 in levelPC8 is a ending address of a discontinuity.

Then further in this example, level PC7 shows that the interrupt routineends at address IN and a return occurs to address A1+1 of the mainroutine. The main routine then executes until illustratively a furtheraddress A2 is indicated at level PC5 whereupon the beginning interruptaddress I1 is entered in stack level PC4. The interrupt is executed toaddress IN of level PC3 whereupon operations return to memory addressA2+1 of level PC2. The main routine continues to execute and reachesaddress A3 entered at level PC1 whereupon an interrupt to address I1occurs and is entered in level PC0.

The state vector leading bits of the program counter trace stack 1821resemble a shift register for stack purposes and the S/E9 end of theshift register is output to an OR gate 1825. OR gate 1825 is furtherconnected to a program count shift out register PCSO 1827. The output ofPCSO 1827 is fed back to a second input of OR gate 1825. When a firstlogic one is pushed from the bottom of the stack 1821 into OR gate 1825,register 1827 indicates the output trace stack full TRFUL for analysiscircuitry of FIG. 69. Subsequent push onto stack 1823 pushes out asubsequent zero from the stack into OR gate 1825. However, register 1827continues to be loaded by OR-gate 1825 (by virtue of the feedback fromPCSO to 1825) with a one indicative of the trace stack being full.

In this way, the state vector leading bits act as a means for countingthe number of discontinuities by a code of alternating ones and zeros.The trace stack 1821 has entries pushable thereon and storage elementsfor extra bits for the entries. PCSO 1827 acts as an overflow storageelement 1827 having an input and an output. OR-gate 1825 acts as asignal combining circuit that has a first input connected to one of thestorage elements (e.g. PC9). OR-gate 1825 also has a second input and anoutput respectively connected to the output and input of the overflowstorage element.

Circuit 221 is generally operative when a branch or an interrupt orother discontinuity occurs to enter a new address into the programcounter 93 in substitution for an address in what would otherwise be acontinuous series of addresses, thereby establishing a discontinuity.Control circuit 221 includes circuitry for pushing the latest addressonto the program counter stack and the new address onto the trace stack.Control circuit 221 is also responsive to addresses from memory and isalso operative on completion of the interrupt routine for poppingprogram counter stack 91 and pushing the trace stack 1821 once again.

When consecutive instructions or interrupts cause discontinuities, morethan five discontinuities can be traced. If the program counter PC isloaded on two consecutive cycles then one less stack level is used,since the current value is the same as the previous new value.

FIG. 73 illustrates a process of operating the circuitry of FIG. 72.Operations commence at a START 1831 and proceed to a test step 1833 todetermine whether a beginning address of a discontinuity is occurring.1833. If not, operations proceed to a test step 1835 to determinewhether there is a return from a subroutine. If not, operations thenloop back to a test step 1837 to determine whether the trace stack isfull. If not, operations return to test step 1833. During the executionof a main routine, for example, the process of FIG. 73 involves arepeated cycle of monitoring steps 1833, 1835 and 1837.

On the other hand, when a discontinuity does occur, operations go fromstep 1833 to a step 1839 to push the latest address (e.g. of the mainroutine) onto both PC stack 91 and trace stack 1821. Then in a step1841, the new address to which operations have branched or beeninterrupted is then pushed onto trace stack 1821. Then in step 1835, solong as the interrupt routine is executing, operations cycle throughsteps 1835, 1837, 1833, 1835 and so on indefinitely. When the interruptroutine is completed, step 1835 branches to a step 1842 to push intotrace stack 1821 the latest address of the interrupt routine from whichoperations are returning. Operations then proceed to a step 1843 to popPC stack 91 to allow the program counter 93 to return to and proceedfrom the address in main routine from which the interrupt was originallytaken.

Next in FIG. 73, operations proceed from step 1843 to a step 1845wherein the latest value to which operations have returned is pushedonto trace stack 1823. Then operations go to step 1837. When asubstantial history of discontinuities has been built up, the tracestack is full at step 1837 and a branch is taken to a step 1847 tooutput the signal TRFUL.

In FIG. 75, the operations of the PC stack 91 are perhaps mosteffectively contrasted with the operations shown in FIG. 72 of programcounter trace stack 1821 in the case of a series of discontinuitieswherein no subroutine nesting or other nesting is involved. In FIG. 72,the addresses of the discontinuities are pushed deeper and deeper intothe trace stack 1823 even though there is no nesting. However in FIG.75, the PC stack 91 either has entered therein just one address or none,due to push followed by pop, precisely because nesting is absent. Theaddress that is pushed is a main routine address A1, A2 or A3 from whichoperations have been interrupted. Upon return, the PC stack 91 is poppedand has no entries as indicated by successive hyphens in the PC stackboxes.

FIG. 76 illustrates a simulated peripheral access feature of thepreferred embodiment. In FIG. 76, as in FIG. 45, host computer 1101 isconnected by a serial line 1103 to apparatus 1043 which includes acircuit board with device 11 thereon and under development. Theapparatus 1043 lacks a peripheral 1871 which is to be provided later.Device 11 includes an electronic processor CPU 1873 which is operable togenerate a first signal to access the peripheral 1871. Peripheral 1871,if it were present, would reply with a second signal on a line ME 1875if the access is either a Read or a Write. When the access is a Read,the peripheral also replies with data.

A sensing circuit 1877 is connected to the electronic processor 1873 totemporarily suspend operations of CPU 1873 when the first signal is sentby CPU 1873 in an attempt to access the peripheral 1871. Sensing circuit1877 is interconnected with analysis and control circuitry 1879. Anscanable interface 1881 is connected to CPU 1873 and supplies thesignals from CPU 1873 to host computer 1101 via the scan path earlierdescribed. Host computer 1101 simulates the absent peripheral 1871 anddetermines what second signal the peripheral 1871 would supply. Then insimulation of that peripheral 1871, host computer 1101 down loads aserial bit stream along line 1103 into interface 1881. Thereupon theinterface 1881 supplies the second signal which peripheral 1871 wouldhave supplied in response to the CPU 1873. In this way, CPU 1873receives a signal as if the absent peripheral were present. A clockcircuit 1882 for CPU 1873 provides a clock signal to the processor.

The arrangement just described is implemented in a preferred embodimentby providing the scanable interface as the message passing peripheral1216 of FIG. 52. The message passing and analysis 1879 are suitablyintegrated with the analysis domain 1217 which is interconnected withthe CPU core domain 1213.

In this way, the simulation of the absent peripheral 1871 causes thedevice 11 to be stopped and started in a manner that allows the hostcomputer 1101 to provide signals in substitution for the absentperipheral 1871 and yet to operate the CPU 1873 at full speed when it isrunning. A visual analogy would be that of a ballerina executing a danceunder a strobe light.

As described, host computer 1101 is operative upon occurrence of signalfrom CPU 1873 of FIG. 76 to simulate the absent peripheral 1871 and loadthe interface 1881 with a representation of the second signal with whichperipheral 1871 would reply if it were present. Then control circuit1879 resumes operation of CPU 1873 so that it receives the second signalfrom the interface even though peripheral 1871 is absent. It is to beunderstood that the arrangement of FIG. 76 is merely illustrative andmay be applied to a variety of circuits as well as a digital processor,such as DMA controllers, UARTs, ASICs and any other circuits which needto be developed in the temporary absence of additional circuitry whichis able to be "impersonated" by the host computer 1101 operating tosimulate the additional circuitry.

FIG. 77 illustrates a method of operating a system such as system 1043of FIG. 75 that is under development and has a first circuit but lacks asecond circuit which is to be provided later. The first circuit sends afirst signal to which a second circuit when present would reply with asecond signal.

In FIG. 77 the method commences with a START 1901 and proceeds to a step1903 to sense the first signal sent by the first circuit to access thesecond circuit. Then in a step 1905, the process temporarily suspendsoperation by the first circuit when the first signal is sensed. Next, astep 1907 simulates the second circuit to generate a representation ofthe second signal. A subsequent step 1909 loads the representation of asecond signal into an interface to the first circuit. Final step 1911resumes operation of the first circuit so that the first circuitreceives the second signal as a simulated reply from the interface. Uponcompletion of step 1911, operations return to start 1901 to repeat theprocess.

FIG. 78 shows a block diagram of message passing circuitry 1216 andlocated on chip. The message passing circuit 1216 is interconnected withthe analysis domain 1217, core domain and communicates with emulationadapter 1203 and scan control 1149. Interrupt generation circuitry 1943also interfaces the rest of message passing circuitry 1216 to the 16interrupt lines in the device 11. A serial scan path of FIGS. 54 and 78has serial data MSIN enter a shift register 1923 CMD/STATUS for entry ofcommands to operate the message passing circuitry 1216 and for scan outof status information. The serial path continues to a further serialregister 1925 designated 16 BIT DATA REGISTER whereupon the scan pathexits on a line designated MSOUT. These shift register correspond toserial/parallel interface 1881 of FIG. 76. The function of shiftregister 1925 can be implemented by register 1813 in the analysis domainand reuse principles can generally minimize the chip real estaterequired for message passing.

The shift register 1925 is connected to the output of a MUX 1931 whichselects one of three paths to load into the register 1925. Two of thesepaths are the data and address portions of the TIBUS peripheral bus ofFIG. 52 and 58. The data portion is designated 1935 and the addressportion is designated 1937 in FIG. 78. The third path called thecommunication register bus 1939 is connected to a communication register1941.

The message passing circuitry 1216 is useful for simulated peripheralaccesses, for communications I/O (input/output) with host computer 1101as an attached processor, and for transferring data structures betweenhost computer 1101 and device 11.

The structure and operation of message passing circuitry 1216 is furtherdescribed in connection with an example of simulated peripheralaccesses. The device 11 suitably parallel-loads the register 1925 viaMUX 1931 when a peripheral access or other outbound communication iscommenced. Host computer 1101 scan up-loads the contents of register1925, and then determines the expected response of the absent peripheralby simulation computations. Host computer 1101 then scan down-loads thesimulated response of the absent peripheral into the register 1925. Thisinformation in register 1925 includes the data which would be returnedfrom the absent peripheral in response to a Read. To convey the data tothe peripheral bus, register 1925 is selected by a MUX 1945 to be loadedinto a communication register 1941. Communication register 1941 thensupplies the data through a MUX 1955 and then an output buffer 1947 ontothe data bus portion 1935 of the TIBUS peripheral bus return to theappropriate part of device 11 under the control circuitry of device 11as if the peripheral were present.

MUX 1945 can also accomplish reverse data transfers whereincommunications outward bound on TI data bus 1935 reach MUX 1945 at aninput 1951 and are communicated via communication register 1941 throughcommunication register bus 1939 and MUX 1931 to the 16-bit data register1925.

MUX 1955 selects either the communication register bus 1939 or anadditional bus 1961 directly connected to data register 1925. In thisway, data can be even more directly communicated from register 1925 viapath 1961, MUX 1955 and output buffer 1947 to the TI data bus.

Buffer status flags are communicated from hardware 1965 of device 11along with Read/Write- signal R/W- to CMD/STATUS register 1923 for scanout to host computer 1101. The host computer receives these bufferstatus flags and returns reply command signals simulating theperipheral, including its "impersonated" reply on line ME.

Some of the command bits from register 1923 are communicated to acommand decoder CMD DEC 1971. Decoder 1971 decodes the commands andselectively activates operation output lines OPO . . . OPN to the MUXesand registers of the message passing circuitry 1216 to operate circuitryin accordance with the commands. Thus, processor-level sophisticationand flexibility are available in message passing circuitry 1216. Infurther aspects, MUX 1945 has an input 1951 connected to the dataportion of the peripheral bus TIBUS for further flexibility. Register1925 is connected to interrupt generation block 1943 so that even theinterrupt status of device 11 can be scan loaded from host computer1101.

It is to be emphasized that functional clock FCLK operates when data isloaded into register 1925 from the device 11 peripheral bus and whenbuffer status flags are loaded into register 1923. Test clock JCLKoperates when the data in registers 1923 and 1925 are scan up-loaded tohost computer 1101, and when data is scan down-loaded to these tworegisters. Then functional FCLK operates to send data from register 1923to command decoder 1971 and to send data from register 1925 to theMUXes, registers and buffers and buses of the message passing circuitryand the rest of device 11. These operations and clock switchingfunctions are accomplished by scan control 1149 and adapter 1203 asdiscussed hereinabove with FIGS. 50 and 59 for instance.

A register UID 1981 is connected to the data bus 1935. A furtherregister JID 1983 is connected to the data register 1925. The outputs ofregisters UID and JID are supplied to a task identification comparecircuit 1985. When the identifications match, an output signal TSKOK isoutput. Thus, when the message passing circuitry has completed its workit can signal its internal condition to any circuit that canadvantageously utilize the information. For example, the task OK signalTSKOK can be used to release a SUSPEND hold on the 12-bit down counter1715 of FIG. 69.

In some cases of message passing, there is a need to perform emulationand simulation functions without halting a CPU in device 11, thuspreserving its ability to service interrupts and perform otherfunctions. This capability permits stop stimuli that normally direct thecore to halt to instead invoke a trap to a reserved location. The userthen links an emulation monitor program to user software to service thetrap. When the trap occurs, the monitor communicates with the emulationhost computer 1101 through a TIBUS peripheral such as message passingcircuitry 1216 register 1925 having an address that resides in the TIBUSaddress space. Once a trap has been taken and until a return fromemulation trap has been executed the CPU and analysis stop stimuli areignored.

FIG. 79 shows a process flow diagram of steps to use host computer 1101of the development tools of FIG. 44 in expanded ways, when the on-chipinterface circuitry 1149, 1203, 1216 is present. A method of operatingan electronic system including a host computer serially connected to anapplication commences with a START 2001 and proceeds to a step 2003 toload host computer 1101 with multipurpose software for scan controlincluding emulation and testability software. Then in a step 2005,functional circuitry such as application system 1043 including device 11is coupled to the scan line 1103 from host computer 1101.

In the next step 2007 the user or an operating system selects a softwareprogram for emulation 2009, stimulation 2013, test in waferfab/manufacturing/field test 2017, and attached processor modes such astemporary coprocessor 2021 and communications I/O 2025. The attachedprocessor modes communicate data related to functional operations of theapplication system by means of a peripheral such as message passingperipheral circuitry 1216 between the host computer and the applicationsystem via the same serial line which also is used for emulation andtestability communications.

Emulation operations 2009 include step 2011 scan operations, machinestate transfers, run, pause and halt among other operations as describedat length herein. In this way signals are produced and inputs are readfrom the system board 1043 as the chip to be used as device 11 wereabsent, so that ultimately when the final chip for device 11 put on theboard in production, it will have the appropriate ROM code and will beoperating in a manner compatible with the board in the application.

Simulation operations 2013 involves executing software in host computer1101 to simulate the target board so that software development for thedevice 11 can be performed by one group of engineers while another groupof engineers is designing the as-yet-unfinished target system 1043. Thedevice 11 could be software simulated, but if a prototype is availableas in FIG. 45, then simulation can be accelerated by executing thedevice 11 software under development on the device 11 itself and onlysimulating the rest of the board 1043 on the host computer 1101. Thiscapability of accelerating simulation using device 11 itself is of majorimportance when the host computer 1101 is of an inexpensive widelyavailable type that is not fast enough to simulate a device running asfast as a DSP, for example.

Instead, the device 11 runs at full speed and then the peripherals (suchas off-chip fast and slow memory) are simulated since they are notaccessed nearly as frequently as memory and registers inside device 11.Step 2015 is the simulated peripheral access operations as discussed inFIG. 76.

A nonexistent or deleted peripheral 1871 is replaced by a single dataport 1216 accessible through the scan test port 1149. An access directedat a non-responding TIBUS address causes the CPU core to halt after thefirst clock of a TIBUS access. The emulation controller 1101 thenextracts the address and the type of access (read or write). Theemulation controller 1101 then provides the data through a register 1925on reads or reads the data directly off the data bus on writes. READYsignals for the completion of the cycle are also provided seriallythrough the scan path to register 1923. After the appropriate transferstake place, the CPU core of device 11 is restarted.

Test step 2017 involves machine state transfers 2019 as host computer1101 scan-loads machine states or test patterns into the SRLs of device11, which are then processed by the logic of device 11 and scanned outand evaluated.

Use of host computer 1101 as a temporary coprocessor for device 11 instep 2021 involves data structure transfers via message passingcircuitry 1216 between host computer 1101 and device 11 as representedby step 2023. Host computer processes the transferred data structuresand then transfers the results back to the device 11 or elsewhere on thetarget board 1043.

The data and results are also able to be sent to video terminal,printer, hard disk, telecommunications modem or other peripheralresources of the host computer 1101 which may be unavailable to device11 otherwise. For this purpose, communication I/O step 2025 performsmessage passing from the device 11 and target board 1043 generally tothe peripheral resources of the host computer 1101 via message passingcircuitry 1216 as represented by step 2027. Transfers and line controlare governed by the host computer 1101.

After any of the above operations are complete, decision step 2029 ofFIG. 79 determines whether more operations are required, in which case,the process flow returns to select program step 2007. If no moreoperations are required, the process flow ends, as represented by step2031.

The ability to qualify all analysis with a user program provided task IDis implemented through the Message Passing Peripheral. The user'sprogram provides a task ID through a TIBUS register value. This value iscompared to a value loaded via scan. The comparison is enabled via anextra bit which may be used to force a valid compare to the Analysissection.

The register 1923 in FIG. 78 is implemented as a 3 bit opcode, a fourbit status field, and a nine bit TIBUS address/read/write latch for atotal of 32 bits.

The delivery of data to algorithms in simulation is readily performedbecause the message passing circuitry 1216 and other circuitry describedherein provide the following features:

1. Peripheral frames (blocks of addresses) may be disabled from decodingaddresses, generating interrupts, and driving the TIBUS peripheral buswith any new code (C0, C1, CX) to be applied to domains.

2. Any peripheral interrupt may be generated from the message module viablock 1943 of FIG. 78.

3. The TIBUS peripheral bus can be programmed by scan to Read and Writeto register 1925 when no frame recognizes a select.

4. The TIBUS peripheral bus can be programmed via scan to stop the coreand device with the second cycle of the bus active, allowing the host1101 to load or unload register 1925 and obtain address and a read/writeindicator.

5. Restart the device execution from the message passing circuitry 1216register 1923.

Each module has a module disable bit which when set through scan,disables the address decode, bus drives, and interrupts. When no moduleacknowledges the TI bus address and the TI bus block is addressed duringsimulation pipe freeze with simulated peripheral access in register 1923enabled, the core stops before the second cycle of the peripheral accessis complete. In this mode, reads are targeted at the message peripheralif no other frame is decoded. All writes are directed at the messageperipheral. When the simulated peripheral access bit in register 1923 isenabled, four status bits are used to specify the number of wait statesassociated with the peripheral access.

Turning to the subject of interrupt generation, two methods of insertinginterrupts exist. The first supports the simulated peripheral accessmode where the interrupts are asserted for one clock when SUSPEND goesinactive after the device starts. The second is the assertion of aninterrupt when the device is running in either the simulation oremulation modes.

The JTAG/MPSD interface of the preferred embodiment herein providesenhanced emulation capabilities at low cycle rates of test clock JCLK,and enables simulation of peripheral functions. The interface furtherprovides extensive internal testing for complex devices in low pin-countpackages. The flexible circuitry of the interface used with hostcomputer 1101 reduces device prototype to production time, and improvesfault testing capabilities in production. The circuitry makes itpossible to do boundary scan at printed wire board (system) level. Thisboundary scan capability is particularly important as board densitiesincrease and the use of surface mount devices with less accessible pinsincreases.

It is emphasized that while the preferred embodiment is discussed inconnection with one processor, an important advantage of itsorganization is that it is architecture independent. Access and controlreach all internal latches. Load/store instruction accesses data RAM.On-chip peripherals are accessed and controlled. The modular approach toeach die with which the circuitry is associated allows isolation andtest of each module independently, and addition or subtraction ofmodules in creation of additional chip members of a chip family. Notonly standard products and their derivatives, but also semicustom chipsand ASIC devices, are supported with a uniform emulation approach andminimum and fully adequate investment. The preferred embodiment makespossible increased fault coverage, and quicker device debug. Emulatorsupport can be made available almost coincident with deviceavailability. In this way there is timely availability of emulation andsoftware development tools upon user's receipt of functional chips insilicon, gallium arsenide and other material systems. The systememulation obviates target cables and is nonintrusive and more fullyreliable. Full speed emulation is available over the life of a chipfamily even as functional clock speed is increased, including chips withbus cycle times exceeding 20 megahertz. Emulation circuitry upgradingfor new members of a chip family is significantly reduced. The type ofemulation circuitry is advantageously independent of the package inwhich the chip is manufactured, unlike the target cable approach. Lessnew information needs to be digested by user for development of systemsusing new chips with software upgrades for emulation. The software canprovide built-in documentation.

Significantly, the preferred embodiment merges test and emulationmethodology. Both test and emulation have common features involving 1)putting the chip into a known state, 2) start/stop execution and 3)dumping the machine state. Scan paths both dump and restore machinestates, and provide a mechanism for invoking memory read/writes. Bothreal-time and non-real-time applications development operations areaddressed with the same toolset and technology, instead of usingseparate test equipment and emulation apparatus.

High speed chips are easily accommodated because specializedfunctionality for emulation is fabricated on-chip. In processor chips,the number of base sets for a given processor core is reduced byeliminating special emulation devices.

Concurrency is herein recognized as a variable defining a spectrum ormatrix of emulation technology into which the preferred embodiment andother embodiments of the invention are seen as new advances. The nexttable categorizes the technology according to the concurrency concept:

                  TABLE                                                           ______________________________________                                        Level   Acronym     Scan         Execute                                      ______________________________________                                        1       LSSD        Entire chip  Entire chip                                  2       MPSD T      Module       Entire chip                                  3       MPSD E      Module       Module                                       4       JTAG/MPSD   Module JCLK  Module FCLK                                                      System Scan  Concurrency                                  5       JTAG/MPSD   Module JCLK  Module FCLK                                                      System Execute                                                                             Concurrency                                  ______________________________________                                    

In concurrency level 1, the entire chip is scanned and then the entirechip is run in order to execute operations. In concurrency level 2,individual modules the chip can be selected for scan, and then theentire chip is run. In concurrency level 3, individual modules in thechip can be selected for scan, and then any selected one or more modulescan be run. In concurrency level 4, boundary scan is integrated withMPSD modular port scan with system 1043 scan concurrency, so that entiresystems can be developed and tested from any level of module throughchip through system. In concurrency level 5, system execute concurrencyis added to level 4. Each level comprehends the capability of allprevious levels.

A message passing aspect of the preferred embodiment involves at leastfour functions. In a first function, a middle-of-access transferinvolves a CPU stop and peripherals stop. Simulated peripheral access isaccomplished, for example, by using this first function. A secondfunction uses the message passing circuitry to latch interrupts whilemessage passing occurs. A third function compares task identifications(IDs) and signals that message passing is still in progress or iscompleted. A fourth function passes messages through the scan serialinterface 1149 to a host computer 1101.

Often a manufactured system board in the context of actual applicationlacks associated video terminals and printers for testing purposes.Using the fourth function, in an attached processor aspect of thepreferred embodiment, the development system acquires control of theapplication system board in its normal user operational aspects asdistinguished from emulation, simulation and debug aspects.

For example if the system board includes an microcontroller, thedevelopment system in the preferred embodiment has a mode of operationby which the development system polls status through the scan serialport or receives interrupts from the microcontroller via the EMUO orEMU1 pins of FIG. 53.

A software interrupt or software trap function in the embeddedmicrocontroller occurs at a predetermined breakpoint therein to signalthe host computer 1101 of FIG. 45 for service. In other words, the hostcomputer in the development system is called as a coprocessor to theembedded microcontroller in the application system. For example, theembedded microcontroller can do file transfers to the development systemacting as attached processor for display and printer purposes.

Two categories of implementation involve 1) nonconcurrent execution and2) concurrent execution.

In category 1 the embedded microcontroller CPU execution ceases forapplication purposes and the CPU transfers data, for example, to thehost computer 1101. Host computer 1101 does memory reads and writesusing the microcontroller CPU registers and then restores the CPU statewhen the transfers are completed.

In category 2 (concurrent execution) a message passing peripheralMSGPASS 1216 of FIGS. 52, 54 and 78 is included in the preferredembodiment combination. Advantageously MSGPASS 1216 allows themicrocontroller to execute other tasks after calling the host computer1101 for service. Then code from the application system is sent via thescan serial line 1103, and inserts interrupts over EMU0 line to softwarecontrol to make host computer 1101 perform the attached processorfunctions.

In this way, a dual function is provided in the six wire SCOPE/MPSDinterface of the preferred embodiment. The system board and itsmicrocontroller are used in a more realistic way using all of the serialand parallel ports on the system board for their application purposeswithout having to temporarily use any of those application ports fortesting and normal development system functions. Thus, the SCOPE/MPSDinterface is not only useful in prototype and manufacturing test, butalso for field test and diagnosis, and retrieving application systemoperational history and accumulated data for display and printing.

Block transfers are accomplished by use of the message passingperipheral 1216 by loading the register 1925 from communication register1941, and with JTAG controller in the IDLE state, do N (e.g 16) bitserial shift, and then cycling back to load register 1925 again. Theblock transfers can be directed to any other serial interface to whichthe scan path is connected. With shift rates well in excess of 10megahertz, substantial communication potential is opened up by dual useas a communications channel of what otherwise might be a mere test port.

In FIG. 78, a half duplex communications protocol accomplishes alternatedownload and upload between host computer 1101 of FIG. 45 and messagepassing peripheral MSGPASS 1216 of FIG. 78. Host computer 1101 scansbits into registers 1923 for use by the microcontroller. The applicationmicrocontroller uses the information and then subsequently loads statusand data bits into registers 1923 and 1925, and then sends a request tothe host computer 1101 to upload. Upon a signal back from host computer1101, serial transfer from registers 1923 and 1925 to host computer 1101is performed. (In an alternative embodiment full duplex hardware andcommunication are provided.)

The message passing peripheral is advantageously further useful fordevelopment system purposes. Host computer 1101 operating as adevelopment system downloads a command to register 1923 requesting themachine state of the embedded microcontroller. The microcontrollerresponds by trapping (analogous to an interrupt) to prestored softwarecode in its memory. The prestored code is executed to cause the contentsof the core registers in the microcontroller to be communicated throughmessage passing peripheral 1216 of FIG. 78 back to the computer 1101.Even as the message passing peripheral operates, concurrency ismaintained and the CPU of the embedded microcontroller is free to acceptinterrupts while doing debug so that real time control functions are notdisturbed.

In this way, message passing peripheral 1216 acts as an electronicsystem which is programmable by the skilled worker for many uses. Forexample, the development system can be detached and anothernon-development-system microprocessor connected in the field for otherpurposes. In this way the SCOPE/MPSD port comprises a highly flexiblecommunications channel for systems applications. Furthermore, the system1043 is free to communicate with its application host processor 1044 ifone is present.

The exposition of emulation, simulation and test now turns to stillfurther aspects. A coassigned scan test U.S. Pat. No. 4,710,933 ishereby incorporated herein by reference.

A preferred embodiment of a graphics system processor, FIG. 80 shows ablock diagram of a GSP chip 2120 having a central processing unit 2200connected by buses 2202, 2204, 2206 and 2208 to register files 2220,instruction cache 2230, host interface 2240 and graphics hardware 2210respectively. A further bus 2205 interconnects a host interface 2240,memory interface 2250, instruction cache 2230, and Input/Outputregisters 2260. Host interface 2240 and memory interface 2250 arerespectively externally accessible via pins and buses 2115 and 2122. Avideo display controller 2270 associated with I/O registers 2260supplies its output on a bus 2124.

FIG. 81 shows a block diagram of unit 2200 of FIG. 80.

For the purposes of testability, the GSP 2120 memory elements are splitinto two types:

(1) Multiple-bit registers such as those in the register file 2220, theCache RAM 2230, a memory address register 2103, memory data register2105 and a field size register 2107. These are all on wide buses, andsufficient logic is included to ensure that there is a route from eachof these registers to local address data (LAD) pins of the chip.

(2) Serial latches, such as an emulation control register 2121, bufferSRLs 2135 of a control ROM (CROM) 2131, and scanable registers of coreprocessing circuitry 2101 on chip. These are put on two scan paths andare accessible via two bidirectional pins SCIN and SCOUT- in test mode.Extra latches are suitably placed as desired to easily observe key logicelements.

One approach to testability herein is called parallel serial scan design(PBSD). A rule is imposed in which every register bit and serial latchare only loaded by some function ANDED with, or conditional on, a singleclock phase (H3T) of FIG. 82. FIG. 82 also shows clock signals H1T, H2T,T3T, H4T, Q1N, Q2N, Q3N and Q4N. The state of the chip can be "frozen"by keeping H3T at a zero level. All other clocks can occur as normal.

The GSP 2120 incorporates four-phase active-low clocks Q1N through Q4Nof FIG. 82 generated from the input clock pin. Also present are fouractive-high half-phase clocks H1T through H4T. As stated previously, allmemory elements are loaded only during the H3T phase. During the normaloperation of the circuit, the clocks look like the normal cycle shown inFIG. 82 leftmost column. During a special scan test mode cycle (middlecolumn), H3T is held low, freezing the normal load of the memoryelements. A special test clock, T3T, is enabled to shift the elementsalong the scan path. During a hold test mode (rightmost column), bothH3T and T3T are held low, thereby freezing the state of the machine.

Each parallel register cell has a circuit shown in FIG. 83. It is loadedon the (normally conditional) H3T phase and is sampled on a(conditional) H1T phase. Control logic and microcode are includedon-chip to enable every parallel register to be loaded and dumped ontothe LAD bus. Thus, the machine state can be loaded up, executed, andthen the results dumped out.

A circuit for each serial latch is shown in FIG. 84. It is similar inform to the parallel register circuit of FIG. 83, but contains anadditional serial input called the scan input Scan In. For the purposesof testability, the H1T sample is connected to the T3T input of the nextelement in the scan chain, so that all the latches are joined togetherin long shift registers. The test clock T3T has the same phase as H3T,but is disabled (zero) in normal operation. In special scan-in/scan-outtest modes, T3T is enabled and H3T is disabled. Data is shifted alongthe scan chain. The clocking scheme minimizes the number of extratransistors required to implement the scan path to as little as onetransistor plus the routing of the test clock.

In order to utilize the parallel and serial latches, control hardware isincluded and connected to reset, run/emu, local interrupt, and holdpins. When both reset and run/emu are pulled low, the values presentedon two local interrupt pins and the hold pin provide a 3-bit code whichis decoded into one of seven possible test modes.

The test modes will normally be used in the following sequence:

(1) Parallel load--Load all registers on the parallel path via the localmemory interface.

(2) Scan-in--Data is shifted into the serial scan paths withoutcorrupting any of the data in the parallel path registers.

(3) Execute--For one or more clock cycles.

(4) Scan-out--Data is shifted serially out of the scan paths withoutcorrupting any of the data in the parallel path registers.

(5) Parallel dump--Dump all registers on the parallel path via the localmemory interface.

Another useful test mode is the hold mode. During this mode the machinestate is frozen by disabling H3T and T3T.

Video controller 2270 has its own independent two-phase clocking schemewith internal phases V5T and V6T derived from a video input clock pin(VCLK). Registers 2260 used by the video controller are loaded on V6Tonly. To get around this in all test modes, the video clocks aredisconnected from the VCLK pin and the two phases are "joined" to H3Tand H1T. Then all the video registers are loaded on V6T, the phasecorresponding to H3T.

Parallel Load/Dump Interface--The control of the parallel load and dumpis performed by the CPU 2200 but the reads to writes to the LAD 2205 aredone by the memory controller 2250. The CPU is just one of severalsources 2200, 2210, 2240, 2260 which can interact with the memorycontroller. It is possible for instance for a DRAM refresh controller torequest a memory cycle in the middle of the load/dump cycle, but thiswould upset the sequence and data would be lost by the tester.

These other sources need to be disabled. This is done by first doing ascan out before a parallel load/dump. This flushes the scan path andclears all requests to the memory controller, ensuring that the CPU isthe only active source.

Cache RAM--For performance reasons relating the interface to the LADbus, the cache is loaded on an H1T. Thus, in order to stop the update ofthe memory elements in the cache, all the cache registers are loadedbased on a signal which is disabled whenever H3T is disabled.

Turning now to FIG. 81, emulation in a preferred embodiment isimplemented with a core 2101 on a GSP chip soldered into a target system1043 of FIG. 45. Another discussion of a data processing apparatus witha self-emulation capability is in coassigned U.S. Pat. No. 5,072,418.

A memory address register MA 2103, a memory data register MD 2105 and afield size register 2107 are associated with main core 2101. A four wirescan interface or port 2111 is connected to a selecting multiplexer MUX2112 and connected to serial data in SCIN 2115 and serial data outSCOUT- 2117 pins. Emulation control pins EC0 and EC1 provide furthercontrol inputs. All of the four wires of interface 2111 are connectedvia a selector circuit 2112 to an emulation control register 2121.Register 2121 is also called a scan control register herein. Specialtest TST and Compress COM bits 0 and 1 in register 2121 are connected toselector circuit 2112 to route the lines 2115 and 2117 to one of threescan paths. The first path allows scan to register 2121 itself. Thesecond path allows scan of CROM buffers 2135 and core 2101. The thirdpath connects to a MUX 2113. The selection is also controllable byemulation control pins EC0 and EC1, which correspond to pins EMU1 andEMU0 earlier described.

A register select code is supplied by emulation control register 2121bits 2-5 SCAN SEL on a line 2125 to control the MUX 2113. In this way,register selection of a selected one of registers 2103, 2105 and 2107 iscontrolled by emulation control register 2121 in its operation of MUX2113. Scan data in and data out on lines 2115 and 2117 are thusselectively routed to registers 2103, 2105 and 2107.

Registers 2103, 2105 and 2107 provide parallel digital communications toand from main CPU 2101. Advantageously, they are accessible serially viaMUX 2113 for scan input and output.

Test modes are controlled via the EC1, EC0 and SCIN pins, and two bitsTEST and COMPRESS of the emulation control register 2121.

The control pins EC1, EC0 and SCIN initially define the state of theemulation control port. Scanning a 1 into the TEST bit zero (0) of thecontrol register 2121 redefines the port as a test control port as longas a code 111 (for EC1, EC0 and SCIN) is not applied to the interface2111. The 111 code is a normal user run mode and also clears the entireemulation control register 2121, including the TEST bit, thus resettingthe port. The relationship of the codes to the MPSD codes tabulatedearlier hereinabove should be apparent. A scan control circuit 1149 ofFIG. 50 is suitably combined with this arrangement according to theconfiguration of FIG. 49 for even further testability, simulation andemulation and message passing advantages.

In FIG. 81 control RON (CROM) 2131 is connected to main CPU 2101. Thesecond bit COMPRESS of the emulation control register 2121 extends thepossible number of test states available via the interface and is usedfor CROM compressions in a type of testing called signature analysis. Insuch signature analysis, a scanable linear feedback shift register 2141of FIG. 86 is combined with the CROM buffers 2135 of FIGS. 81 and 85 andis used to self test the CROM 2131. A compression test clock C3T is alsoused in this self-test operation. For earlier signature analysisapproaches see coassigned Sridhar U.S. Pat. Nos. 4,601,034 and ThatteU.S. Pat. No. 4,594,711 hereby both incorporated herein by reference.Alternative embodiments can use any BIST (Built In Self Test)configuration and process.

The CROM on the G8P2 has approximately 450,000 transistor sites; thereare 256 outputs and 1,568 states. The states are accessed via a noveluse of two memory maps. A total of 1,280 states are controlled by a11-bit micro-jump (UJ) address code, and the 256 entry-point states aredirectly controlled by explicit opcode decodes. The selection betweenentry point or UJ is controlled by a CROM output to a MUX 2137 of FIG.85.

In FIG. 86, the scanable linear feedback shift register 2141 utilizes adata compression method of self-testing the CROM. The method accessesevery state. For each access, a word is generated in the CROM outputbuffer stage 2135.1, 2135.2, 2135.i, 2135.j etc., from the XOR(exclusive OR) of the new data with the data previously held in theadjacent buffer stage. A further XOR gate 2143 has two inputs connectedto a midpoint tap and a right most line. XOR gate 2143 has its outputfeeding back to the leftmost signature block. The CROM buffers 2135 withsignature circuits 2141 thus form a signature analyzer. The basiccomponent circuit of the CROM buffer is shown in FIG. 87. An XOR circuit2151 has inputs connected to a CROM output line and a scan line from theadjacent buffer stage. The output of the XOR 2151 is connected to alatch 2153.

C3T is a special compress clock. It is held low during normal and scanoperations, but is enabled during COMPRESS mode (when H3T and T3T aredisabled) to generate the signature.

This flow of data causes an incorrect data bit to invert the sense ofone bit of data being shifted around the buffers. When the entire CROMhas been accessed in this manner, the contents of the CROM buffersignature analyzer are re-examined by scanning them out.

The data (signature) that is scanned out is compared to the expecteddata so validity of the code in the CROM is determined.

The analysis method herein takes into account the possibility thatmultiple faults may be undetected. While a single inverted bit,representing a fault, is being shifted-around the signature analyzer, itcould be "hit" by another fault, and so get get toggled back to thecorrect value. This happens if the second fault is both N outputs"downstream" and N addresses away. To overcome this problem, thecircuitry and method implemented herein preferably presents addresses tothe address decoders in two different sequences, the first time countingup and the second time counting down, virtually eliminating thepossibility of undetected faults.

The feedback term for the signature analizer is the XOR of the finalterm and a term near the middle of the CROM. The exact position of thismiddle term is flexible.

A stack register 2145 in normal operation is used during micro-statepops and pushes in the circuit of FIG. 85. In CROW test mode thisregister 2145 is reused as a 13-bit counter. The two most significantbits of the counter are used to control whether it is counting up ordown, and whether the value is to go to an opcode decoder 2147 or amicro-jump address decoder 2149 associated with a logic matrix 2152 ofthe CROM. The total number of cycles required to test the CROM istherefore 2¹³ (8K) plus the initial scan-in to initialize the registersand counters, plus the final scan-out to check the resulting signature.Therefore, at a clock frequency of 10 MHz, the complete CROM testrequires less than 1 millisecond.

One major advantage of this type of test is that it can be performedwith a simple, low-performance, low-pin count tester, but givesexcellent fault coverage.

The codes for testability are shown in Table V. Table V has 5 columnsvertically labeled TEST, COMP (compress), EC1, EC0, and SCIN in thatorder from left to right.

TABLE V

    ______________________________________                                        T   C               S                                                         E   O     E     E   C                                                         S   M     C     C   I                                                         T   P     1     0   N   REMARKS                                               ______________________________________                                        1   X     1     0   0   HOLD    No. H3T phase clocks, i.e. no                                                 H3T, V6T, T3T or C3T                          1   X     1     0   1   RUNTEST Clocks not affected, port is                                                  testport                                      1   X     0     0   D   SCAN    Scan the serial path, T3T                                                     active; H3T, C3T, V6T inactive                1   0     1     1   0   EXECUTE Enable H3T, V6T locked to H3T                 1   X     0     1   0   PARALLEL                                                                              Enable H3T, V6T locked to H3T                                         LOAD                                                  1   X     0     1   1   PARALLEL                                                                              Enable H3T, V6T locked to H3T                                         DUMP                                                  1   1     1     1   0   CROM    Compression. Activates C3T.                                                   No H3T or T3T or V6T                          X   X     1     1   1   EXIT    From test mode, clears TEST and                                               COMPRESS bits                                 ______________________________________                                    

The scan sequences are as follows wherein hyphens separate the steps ineach sequence. A glossary of mnemonics follows the list of sequences.

1. Initialize State--Used to start the machine in a specific knownstate:

    SCANTEST-PLOAD-SCAN(I)-EXIT/RUN

2. Single Stepping--Used to execute for one cycle (e.g. from ATGpattern) and examine the result

    SCANTEST-PLOAD-SCAN(I)-EXECUTE-SCAN(O)-PDUMP

3. Test Examine--Examine the state of the machine in the middle of afunctional pattern:

    SCANTEST-RUNTEST-HOLD-SCAN(O)-PDUMP

4. Compress-Performs signature analysis/data compression on CROM output:

    SCANCOMP-PLOAD-SCAN(I)-CROM-SCAN(O)

SCANTEST means "Scan TEST bit into control register".

SCANCOMP means "Scan TEST and COMPRESS bits into control register".

SCAN is a simultaneous scan in and scan out. Scan(I) implies the scan isscan-in for data initialization. SCAN(O) implies the scan is scan-outfor data examination.

For parallel load and dump PLOAD and PDUMP, start and execute states aregenerated internally. Externally, the pins are timed with a set up timeof 20 nanoseconds and a zero hold time with respect to rising transitionof a clock signal LCLK1.

In order to test the emulator functions, the functional code 111 isapplied for two cycles to exit the test mode and clear the entirecontents of the scan control register. If the TEST bit is set, the firstcycle clears only the test bit. In the second cycle, the code 111 andthe cleared TEST bit then clears the rest of the scan control register2121. In this way, exit occurs from the test mode into an emulation modesuch as an emulation controlled run.

The TEST and COMPRESS bits in this embodiment are only set via the scancontrol mode and then are only cleared by application of the code 111.These two bits TEST and COMPRESS are not on the serial test scan path.

The foregoing discussion has generally emphasized test aspects in theGSP 2120. The following discussion generally emphasizes emulationaspects.

Using the scan sequences, emulation functions are provided in theembodiment of FIG. 81 that include:

1. Simple breakpoints, qualification on IAQ (instruction acquisition)only, and multiple breakpoints set before execution period via memorysubstitution. A stop point occurs before instruction execution.

2. Memory modification, inspect and/or alter, while the processor is instop mode without change to user environment. This includes internal(I/O register) and external memory spaces. Inspection and/ormodification while in stop mode is also performed. Modification of allinternal registers including PC (program counter), ST(status register),and SP (stack pointer) while in stop mode is also available.

3. Single stepping of instructions.

Functions involving the use of a target cable include the following:

1. Hardware breakpoints, qualification on memory write (MW), memory read(MR), instruction acquisition (IAQ), as well as address and datahardware breakpoints. The breakpoints are multiple or sequenced. Anevent counter 1715 of FIG. 64 provides a breakpoint on occurrence of arepeated occurrence of a predetermined condition. A stop point isdefined at a predetermined time after a breakpoint event has occurred.

2. A time stamp on trace information is provided as delta time, markedtime, or elapsed time.

3. Performance analysis is provided on inner and outer program loopswith an overall loop counter.

4. Emulator memory is overlaid for software development. In this way, anexternal memory can hold external software and be accessed by CPU 2101using addresses which access on-chip memory after development iscompleted.

5. Trace of memory operation instruction acquisition IAQ, memory read,and memory write are provided in real time.

SCOUT- is an output pin that is used for scan output of data in the scanmode and for output of a stop acknowledge indication in run modes.

It is emphasized that the use of a target cable can also be eliminatedby utilizing the on-chip adapter 1203 discussed at length earlierhereinabove.

An external event such as a hardware breakpoint or user keyboardindicates or signals a stop. The emulation hardware sets a halt code onEC1, EC0, and SCIN and awaits a stop acknowledge STOPACK on the outputpin SCOUT-.

Internal state information utilized by the emulator host computer 1101of FIG. 45 includes the program counter PC, the register file of CPU2101 and cache, segment registers and p-flags.

The codes available at the pins EC1, EC0 and SCIN are as follows: Normalfunctional mode, controlled execution mode, halt, pause, emulationcontrol register scan and scan of data registers 2103, 2105 and 2107.See Table VI. These codes are essentially the MPSD codes discussedearlier hereinabove.

                  TABLE VI                                                        ______________________________________                                        EC1   EC0      SCIN                                                           ______________________________________                                        1     1        1        Normal functional mode;                                                       Scan control register disabled                        1     1        0        Controlled execution mode; CPU                                                active scan control register enabled                  1     0        1        Halt; (CPU only)                                      1     0        0        Pause/Stop scan clocks                                0     1        D        Emulation control register scan with                                          (D) from SCIN                                         0     0        D        Data register scan with (D) from                      ______________________________________                                                                SCIN                                              

The normal functional mode is utilized in designed of systems and isobtainable by letting the emulation pins float electrically. The pinshave a pull up resistor on chip. The normal functional mode disable theinternal control registers 2103, 2105 and 2107 for emulation and tests,advantageously eliminating preloading of these registers through scanpaths.

CROM 2131 is preloaded with microcode which establishes the emulatorfunctions, memory inspect/modify and internal state load/dump.

All of the registers are scanned in through the LSB (least significantbit) band out through the MSB (most significant bit). Emulator controlregister 2121 is scannable in response to the Table VI code "emulationcontrol register scan" applied to pins EC1 and EC0.

The normal functional mode is the normal operating mode without anemulator. It is used to initially reset the chip upon power up. Reset isa global signal within the chip. The functional run mods codecontinuously clears the emulation control register 2121.

The controlled execution mode is used for running code or for executionspecial functions such as load and dump. In this mode, reset is gatedwith a Block Reset bit in the emulation control register. The emulationcontrol register 2121 is not cleared on reset in this mode.

A portion of the microcode responds to the HALT code to halt the CPU foremulation. The halt state is entered in any of the following when any ofthe following conditions is present:

1. A halt code on the emulation pins;

2. An emulation breakpoint opcode;

3. Completion of a single-step operation; or

4. A memory access completion requested by the emulator.

The emulation modes are recognized on instruction boundaries or normallyinterruptable points of operation in the CPU 2101.

In the normal functional mode, no emulator is assumed and a softwaretrap is taken in executing the microcode when a stop condition isrequired. If the emulation control pins are in any other state, thepresence of an emulator or host computer 1101 is assumed and the CPU2101 waits in a loop awaiting a halt code when a stop condition isrequested by the emulator.

The CPU 2101 enters the halt state by performing the followingoperations when in the normal functional mode. First, the CPU waits forany CPU initiated memory cycles to complete. Second, the CPU stores thecontents of the program counter PC in the memory data register 2105.Third, the CPU signals the stop by generating a STOPACK signal, forcingscan out line SCOUT low. Fourth, the CPU takes a software trap providedfor this situation.

If the CPU is in any state other than the normal functional mode, theCPU enters its HALT state by performing the following set of actions.The CPU performs all of the previously stated functions except thesoftware trap. Instead of the software trap, the CPU waits for a HALTcode on the emulator pins and then lastly enters halt microcode. WhereCPU 2101 is part of a graphics signal processing chip (GSP), the memorycontroller, host interface and video timing logic continue to operatenormally.

A further mode called the pause mode is used to stop serial shift logicin the middle of data being shifted and immediately stop the chip forthe tester or emulator. PAUSE is accomplished by inhibiting all clockson chip.

Scan modes of the system involve scans which occur at the rate of onebit per cycle of LCLK1. Internally, data is latched at the end of H3which is approximately the rising edge of LCLK1. Set up and hold timesare shown in Table VII.

                  TABLE VII                                                       ______________________________________                                                   Parameter    Min    Max    Unit                                    ______________________________________                                        Tsu (EC-CLK1H)                                                                             Setup time of EC                                                                             20          ns                                                 pins valid before                                                             CLK1 high                                                        Thd (EC-CLK1H)                                                                             Hold time of EC                                                                              0           ns                                                 pins valid after                                                              CLK1 high                                                        Td (CLK1H-SCOUTL)                                                                          Delay time from CLK1  20   ns                                                 high to SCOUT low                                                Td (CLK1H-SCOUTH)                                                                          Delay time from CLK1  20   ns                                                 high to SCOUT high                                               ______________________________________                                    

Establishing either the control mode or the data scan mode inhibits CPUstate machine activity while the mode code is applied. This allows datato be scanned without being acted upon until the data is in its finaldesired position in the scan chain. SCANIN and SCANOUT are bothaccomplished in the same scan.

The scannable registers are memory address register 2013, memory dataregister 2105 and field size register 2107. Register 2103 and 2105 eachhave 32 bits, For example, the field size register 2107 is 6 bits. Theregister to be scanned is determined by a data scan select field (bits2-5) of the emulation control register 2121.

The microcode in the CROM accomplishes four main functions on command.First, it transfers data from a selected device register or from cacheor from program counter to the memory data MD register 2105. Second, ittransfers from the MD register 2105 to a selected device register or tocache or to program counter. Third, it executes MPSD code to dostep-by-step operations. Fourth, it sends instructions to the memoryinterface 2250 to transfer data either way between external memory andthe register pair MD 2105 and MA 2013.

Memory address register 2103 holds the address for all CPU initiatedmemory accesses including those of the emulator. After a memory accessis completed, register 2103 is incremented by 32 bits to point to thenext word address. The low 5 bits are left unchanged. When the chip ishalted, the program counter PC contents are loaded into the upper 28bits and the halt condition code occupies the low four bits of thisregister.

Memory data register 2105 passes data between the emulator and memorycontroller. Register 2105 serves as a data latch for passing databetween the emulator and the CPU for loads and dumps. When the CPU isinitially halted, this register 2105 contains an image of the CPUprogram counter and a halt code in the low order four bits. This codeindicates the type of cycle that is halted. The halt codes are shown inTable VIII.

                  TABLE VIII                                                      ______________________________________                                        MD3  MD2    MD1    MD0                                                        ______________________________________                                        0    0      0      0    Normal halt code                                      0    0      0      1    Halt during pixel black transfer                                              (pixblt) ar IDLE                                      0    0      1      0    Halt during RESET                                     0    1      0      0    Halt from EMU opcode                                  1    0      0      0    Halt during single step                               1    1      1      1    Halt due to Bus Fault on EMU memory                                           access                                                ______________________________________                                    

The field size register 2107 makes it possible to do memory accesses todata fields of various sizes specifiable by the field size register.

The value loaded into register 2107 is a 6 bit code that indicates thenumber of bits to be written. Using register 2107 permits the emulatorto write to bits or fields without having to do a read-modify-writeoperational sequence, which could interfere with host computer accessoperations occurring between the read and write of the sequence. Whenthe CPU is initially halted, the register 2107 contains an indeterminatevalue, since it is the actual latch and not a copy. Scan in of a valueinto register 2107 enters the value in the most significant 6 bits ofregister 2107. Upon scanning out the value, the value is in the leastsignificant 6 bits of register 2107.

The emulation control register has bits as specified in Table IX. Thecontents of emulation control register 2121 are not executed untilcontrol scan mode is changed to another MUX.

                  TABLE IX                                                        ______________________________________                                        Bit    Function      Description                                              ______________________________________                                         0     Test mode enable                                                                            Puts device in production                                                     test mode TEST                                            1     Signature enable                                                                            Puts device in CROM signature mode                                            (COMPRESS)                                               5-2    Data Scan Select-                                                                           Selects which register is scanned                               4 bits        an a data scan                                           9-6    EMU Function Code-                                                                          Read/write/load/dump select                                     4 bits                                                                 10     EMU busy enable                                                                             Connects CPU to emulator busy                                                 rather than memory controller                            11     Load mapper enable                                                                          Conditions control to load                                                    overlay mapper                                           12     Memory cycle abort                                                                          Aborts current memory cycle                              13     MAP/WP enable Enables mapping and write                                                     protect logic                                            14     Macro mode    Blocks RESET, NMI and flushing                                                the CACHE                                                15     Block host port                                                                             Blocks host port cycles, causes                                               not ready                                                16     Single step   Forces CPU to execute one                                                     instruction                                              17     CPU priority  Raises CPU priority above Host                           18     Device disable                                                                              Disables the device and                                                       tri-states all pins                                      19     EMUReset      Emulator generated reset                                 20     EMUINT        Forces emulator to halt during                                                an idle instruction or pixblt                            29     Cache flush flag                                                                            Indicates a cache flush                                                       condition                                                29     BUSERR flag   Indicates a bus error                                                         condition                                                30     RETRY flag    Indicates a memory retry                                                      condition                                                31     MEMCTL BUSY flag                                                                            Indicates that the memory                                                     controller is busy or that the                                                emubusy bit is set                                       ______________________________________                                    

Four bits 2-5 in the emulation control register 2121 select one of theregisters 2103, 2105 and 2107 for serial scan during Data Register Scanmode. During normal functional mode, these four bits are cleared tozero. Table X shows the scannable registers and their scan codes.

                  TABLE X                                                         ______________________________________                                        SCN3  SCN2      SCN1    SCN0    Select Code                                   ______________________________________                                        0     0         0       0       Scan MA                                       0     0         0       1       Scan MD                                       0     0         1       0       Scan Data Size Latch                          ______________________________________                                    

The emulator supports a set of functions that are tabulated in Table XI.The proper function code is placed in the emulation control register.The processor CPU 2101 is then placed in the controlled run mode. TheCPU 2101 then forces line SCOUT high, indicating that the function isbeing executed. When the operation is complete, CPU 2101 forces lineSCOUT low again. During normal functional mode, these four bits arecleared to zero.

                  TABLE XI                                                        ______________________________________                                        FCN3   FCN2        FCN1    FCN0                                               ______________________________________                                        0      0       0       0     Reserved                                         0      0       0       1     Run                                              0      0       1       0     Reserved                                         0      0       1       1     Return to reset                                  0      1       0       0     Reserved                                         0      1       0       1     Resume Interrupted Instruction                   0      1       1       0     Reserved                                         0      1       1       1     Run Macro                                        1      0       0       0     Dump ST, PC                                      1      0       0       1     Dump Reg. File                                   1      0       1       0     Dump Cache                                       1      0       1       1     Load ST, PC                                      1      1       0       0     Load Reg                                         1      1       0       0     Load Reg. File                                   1      1       0       1     Load Cache                                       1      1       1       0     Read Memory (inc address)                        1      1       1       1     Write Memory (inc address)                       ______________________________________                                    

The bits FCN3, FCN2, FCN1 and FCN0 occupy bits 9-6 of the emulationcontrol register 2121.

An emulator run mode of Table XI is used by the emulator to execute usercode on CPU 2101 by running or single stepping.

In emulator dump functions, the emulator scans in a request for a dump.The CPU 2101 then fetches the requested parts of the machine state andloads them into the memory data register 2105 one by one. For each groupof 32 bits, the emulator host computer 1101 scans out memory dataregister 2105 serially to obtain the data. More specifically, theoperation for emulator dump is as follows. First, the emulator scans inthe four bit function code of Table XI to dump the state using thecontrol scan mode and sets the emulator busy enable bit 10 of register2121. Second, the emulator enters the controlled execution mode. Third,the CPU 2101 forces SCOUT pin high. Fourth, the CPU 2101 places a 32 bitword of the machine state in register 2105 and forces SCOUT pin low.Fifth, CPU waits for the cycle to complete. When emulator busy bit isenabled, the CPU signals stop acknowledge STOPACK on the SCOUT pin low.Sixth, the emulator enters a data scan mode and scans the register 2105.When scanning, the CPU 2101 is inhibited from concurrent activity inthis embodiment. Seventh, operations return to step two for the controlexecution mode. Exiting the scan mode clears the emulator busy flag.

The end of the process is determined by the known number of words todump. After dumping the cache and the register file, an extra controlledrun is executed after the last word has been scanned out so that the CPUcan complete its state sequence and return to halt. The CPU 2101 signalsthe return to halt by asserting STOPACK.

The emulator then clears the emulator busy bit in the emulation controlregister 2121.

For example, in the function DUMP ST,PC, the "1000" function code causesthe CPU program counter and status register to be dumped. The statusregister is dumped first, followed by the PC.

In the DUMP REG.FILE function, the "1001" function code causes the A andB register files to be dumped in that order.

In the DUMP CACHE function, the "1010" function code causes the cache tobe dumped. (The cache has registers in different segments. A leastrecently used LRU segment is overwritten from external memory in normalcache operation.) Cache dump occurs in the following sequence. The dataregisters, each followed by respective Present (P) flags, are dumpedfirst starting with segment A so that 32 segment A registers arefollowed by segment A Present flags, then the same for the othersegments. Next, the A segment start address is dumped with 9 LSBs set tozero. The next three words contain the segment B, C and D addresses. Thefinal word contains the LRU stack that identifies the segments accordingto the least recently used LRU criterion. The two LSBs contain thenumber of the least recently used segment. The next recently usedsegment numbers are packed into adjoining bits up to bits 6 and 7 whichcontain the most recently used segment number. The total number of wordsdumped is 137.

In emulator load functions, designated by codes 1011, 1100 and 1101, theemulator scans in a load request and values into the register 2105. CPU2105 then builds the machine state from values in register 2105. First,the emulator scans in the code to load the state using the emulationcontrol register scan mode and then sets the emulator busy bit. Second,the emulator scans in register 2105 using the data register scan mode.Third, the emulator enters the controlled execution mode, and fourth,the CPU 2101 forces line SCOUT high. Fifth, the CPU requests a write ofa 32 bit word of the machine state and waits for the cycle to complete.After the data has been loaded, line SCOUT is forced low. Sixth, theemulator scans a succeeding 32 bit word into register 2105. Exiting thedata scan register mode clears the busy flag. Seventh, operations returnto the third step of entering the third execution mode. The end of thisprocess is determined by the number of words to load which is apredetermined number. The emulator then clears the emulation busy enablebit 10 in the emulation control register 2121.

In the LOAD PC,ST function, the 1011 function code causes the statusregister to be loaded followed by the CPU program counter. In the LOADREGS 1100 function code, the A and B register files are loaded in thatorder. In the LOAD CACHE function 1101 code, the cache is loadedstarting with segment A followed by LRU stack then P flags for segment Afollowed by 32 segment A data registers. Then the same operations areperformed for segments B, C and D. After loading segment D. Afterloading segment D, a dummy load is loaded. The total number of wordsloaded is 138 in this embodiment.

The emulator can access any part of the chip address space including I/Oregisters by scanning in address values to register 2103 and data valuesto register 2105, together with a memory read or write function code toemulation control register 2121. When the CPU is in the emulator haltstate, these registers are available to the emulator and the controlledexecution mode is then entered. The CPU is then controlled in such a waythat it requests the memory access and then upon completing the access,the CPU returns to the emulator halt state. In this way on-chipfunctions are implemented with transitions from state to state in theCROM acting as a state machine in this alternative embodiment to thehardwired adapter 1203 circuitry of FIG. 59. The normal halt sequencethen signals the emulator that the memory access is complete. Afterdownloading code using this mechanism, the emulator flushes the cache bysetting the cache flush bit 29 in the emulation control register 2121.

The functions of the bits of emulation control register 2121 (which isanalogous to emulation control register 1251 of FIG. 59) are nowdiscussed in even further specific detail. If emulation busy enable bit10 is set when the CPU requests a memory access, then to CPU 2101 thememory interface appears to be busy. This inhibits the CPU frommodifying registers 2103 and 2105 and gives the emulator time to scandata out. The busy flag remains set until controlled functional mode isre-entered.

Load Mapper enable bit 11 forces the memory controller to generate aspecial type of memory write cycle. Bit 11 accomplishes this by forcinga load mapper bus status code and by blocking the RAS and buffer controloutputs. This allows the CPU to use memory write microcode to supportloading of the Mapper. During normal functional mode, this bit iscleared to zero. The emulator insures that the "data" part of the MAregister 2103 contents is not contained in the least significant fivebits as these bits of the register 2103 are not output to the LAD bus.The emulator insures that the least significant five bits are loadedwith zeros to insure that the memory controller does not perform thecycle twice regarding it as a non-aligned write.

A memory cycle port bit 12 signals that the current memory cycle shouldbe aborted. Before another memory cycle can be started, this bit iscleared by the emulator. During normal functional mode, this bit iscleared to zero.

A MAP/WP enable bit when set, enables Overlay Mapping and Write Protectfeatures. When this bit is set, the time multiplexing on the PAGMD-,BUSER, and the size 16- pin is also enabled during normal functionalmode this bit is cleared to zero.

A Macro mode bit 14 makes it possible to run programs in cache withoutbeing affected by a functional host computer HCF of FIG. 80. This bitblocks reset, all interrupts, and the cache enable bit. The cache Pflags are not checked during Macro mode, and can be cleared by the hostHCF. When reloading the cache, the P flags should not be changed. Duringnormal functional mode, this bit is cleared to zero.

A block host port bit 15 prevents the functional host computer HCF fromasserting accesses through the host port lines 2115. If the host HCFmakes an access when this bit is set, the host port 2240 is put in thenot ready state until the bit is cleared. This feature is used inconjunction with a host port protocol. During normal functional mode,this bit is cleared to zero.

A single step control bit 16 in the emulation control register 2121causes core 2101 to execute only one instruction before generating astop acknowledge STOPACK signal on the SCOUT- pin to indicate anemulation stopped condition. This is similar to forcing an emulationinstruction into the instruction stream after the current instruction.This bit ORed with the single step bit in the status register beforegoing to the microcontroller. During normal functional mode, this bit iscleared to zero.

A CPU priority bit raises the CPU's priority above host HCF accesses.This allows the emulator to steal cycles to load the Mapper and memorywithout completely blocking the host port 2240. During normal functionalmode, this bit is cleared to zero.

A device disable bit 18 disables all outputs including the clocks.Normal functional mode forces an exit from this mode. During normalfunctional mode, the bit is cleared to zero.

An EMUReset bit is ORed with the reset input. Writing a "1" to this bitgenerates a reset condition. This bit is cleared when further operationsare to be executed.

An emulation interrupt bit EMUINT when set forces an emulationinterrupt. In this way, an IDLE instruction can be interrupted. This bitis effective when both it is set and the halt code is placed on theemulator pins.

A cache flush flag 29 indicates that a cache flush has occurred during acurrent emulator access. This flag is automatically cleared when scannedout. During normal functional mode, this flag is cleared to zero.

A BUSERR flag indicates that a memory bus error has been detected on theBUSER and LRDY pins during a current emulator memory access. This flagis automatically cleared when scanned out. During normal functionalmode, this flag is cleared to zero. If a bus fault occurs on either anemulator 1101 initiated access or during a macro, the CPU asserts aSTOPACK and waits for a halt signal from the emulator hardware. When thehalt is received, the CPU 2101 inserts a code 1111 (halt due to busfault) on the least significant four bits of memory address register2103, along with the contents of the program counter.

A RETRY flag 30 indicates that the target system has requested a memoryretry on the BUSERR and LRDY pins during the current emulator memoryaccess. This flag is automatically cleared when scanned out. Duringnormal functional mode, this flag is cleared to zero.

A memory controller busy flag MEMCTL BUSY is used by scan logic todetect that an emulator requested memory cycle has completed. This bitis not latched and is read by the emulator.

Turning now to the subject of breakpoints, software breakpoints aresuitably used for software code development and debug. Multiplebreakpoints can be set during the stop mode (control mode). When theuser initiates a run, any of the breakpoints insures a processor 2101stop. Upon the occurrence of a breakpoint event, the breakpoint iscleared from the user's breakpoint stack. This permits continuation ofprogram flow without interruption by the breakpoint just encountered.

The mechanism for software breakpoints utilizes an emulation instructiondesignated "EMU". This instruction when encountered in the instructionstream by CPU 2101 causes the CPU to send a STOPACK signal. In this way,the program counter PC is left pointing to the EMU instruction which ithas encountered. To remove the breakpoint, the emulator reinserts theoriginal instruction into memory and flushes the cache.

For software debug and emulation purposes, there are two versions of theEMU instruction. Illustratively, the opcodes are 0100h for a "normal"EMU instruction. This causes the CPU to take a software trap. Anotheropcode 0110h for an "EMU present" instruction causes CPU 2101 togenerate STOPACK and wait in a loop until a halt code is present. Whenthe emulator computer 1101 establishes the halt signal on pins EC0 andEC1, CPU 2101 jumps to emulation halt microcode.

A single step mode bit 16 in the emulation control register and asimilar bit in CPU 2101 status register, control CPU function for singlestep. When either of the single step bits are set to "1", the CPU haltsafter instruction execution and executes operand transfer cycles forthat particular instruction. That is, the next instruction is executedwhich is either the instruction presently identified by the programcounter PC or the first instruction of an interrupt service routine. Itis to be noted that the single step operation is similar to theemulation stop sequence. The cache behaves normally during single step.If the emulator is to disable fetches of other instructions (cache fill)it sets the cache disable or cache flush bits before single step. Inthis way, fetching of other instructions is preventing.

In order to make a transition into a single step or normal run mode,interrupts are sampled prior to the instruction being allowed toexecute. Then if an unmasked interrupt is pending, the core 2101 takes atrap and the first instruction (or the only instruction in single stepmode) is that instruction to which the interrupt vector points.

Interrupt logic associated with core 2101 monitors for interruptsregardless of the state of the emulation control register 2121. Thus,the state of an INTPEND IO register will be the same as if the core 2101has interrupts masked for any HALT/SCAN periods. On a transition intorun or single step with the interrupt enable bit of the status registerset, the highest priority pending interrupt is taken. In this way, theinterrupt enable bit is cleared of status which inhibits furtherinterrupts without emulator 1101 or software intervention. The interruptacknowledgment is suitably a status code output during the interruptvector fetch. Since the CPU initiates the memory cycles, this statuscode output is completed before the stop acknowledge signal STOPACK- isissued. Both interrupts and emulator stops occur on instructionboundaries, or when interrupts are sampled on interruptableinstructions. In the event that both interrupts and emulator stop arerequested on a given instruction boundary, emulator stop takesprecedence.

In the emulation mode, for example, the emulation hardware uses themultiplexed emulation pin functions to start and stop, single step,execute macro instructions, scan out and scan in internal machinestatus. A typical emulation sequence is RUN-STOP-RUN as illustrated byTable XII.

                  TABLE XII                                                       ______________________________________                                        Emulation Pins  Scan Data                                                     ______________________________________                                        Wait for SCOUT-low                                                            Scan EMU Control                                                                              Set Data SCAN=MA                                              Scan DATA       MA=0×801000                                             Scan EMU Control                                                                              SCAN=MD, FCN=WRITE MEM,                                                       EMU Busy En=1                                                 Scan Data       MD=data                                                       Controlled Run                                                                SCOUT-Goes High                                                               Wait for SCOUT-Low                                                            HALT or SCAN                                                                  ______________________________________                                    

Hardware reset should reset the chip without destroying the contents ofoverlay memory. In normal functional mode, reset becomes a global resetthat is intended for initial power up. Reset should be blocked when thehalt, pause, or scan modes are placed on the emulator pins. Reset shouldalso be blocked when in the MACRO mode. Further, in other than normalfunctional mode, the memory controller should complete any memory cyclesin progress (memory abort) without destroying memory contents upon resetand should perform-refreshes while reset is low.

The overlay memory consists of one or two pages of DRAM that can bemapped on programmable boundaries. The mapping is done by high speedstatic RAMs connected to the latched bus 2122. The output of one of theRAMs when active low indicates that the memory access should come fromthe overlay memory and not the chip containing core 2102. This is doneby blocking the normal outputs and providing new signals to the overlaymemory. This memory is considered local to the emulator and is notaccessed from the target system including the chip.

It should be understood that various embodiments of the invention canemploy, hardware, software or microcoded firmware. Process diagramsherein are also representative of flow diagrams for microcoded andsoftware based embodiments.

While this invention has been described with reference to illustrativeembodiments, this description is not intended to be construed in alimiting sense. Various modifications and combinations of theillustrative embodiments, as well as other embodiments of the invention,will be apparent to persons skilled in the art upon reference to thisdescription. It is therefore contemplated that the appended claims coverany such modifications or embodiments as fall within the true scope ofthe invention.

    ______________________________________                                        APPENDIX                                                                      EMULATOR COMMANDS                                                             Command Syntax                                                                           Operation Description                                              ______________________________________                                        BREAKPOINT COMMANDS                                                           BA address Breakpoint on Acquisition-breakpoint occurs when                              instruction is loaded into the instruction register.               BD id number                                                                             Breakpoint Delete-delete breakpoint number id                                 number.                                                            BL filename                                                                              Breakpoint Load-load breakpoints stored in file-                              name.                                                              BR         Breakpoint(s) Remove-remove all breakpoints.                       BS filename                                                                              Breakpoint Save-save all breakpoints in filename.                  CONFIGURATION COMMANDS                                                        CC         Configure Colors-set color, reversing, and blinking                           for screen.                                                        CM         Configure Memory mode-enter mode; mnemonic's                                  final letter and operand(s) define action.                         CMA low address,                                                                         Configure Memory Add-designate a block of mem-                     hi address, type,                                                                        ory to be added to the memory configuration.                       {R | R/W}                                                            CMD id number                                                                            Configure Memory Delete-delete the memory de-                                 fined by the id number assigned by the CMA com-                               mand.                                                              CME id number,                                                                           Configure Memory Edit-edits the memory block de-                   low addr, high                                                                           fined by the id number assigned by the CMA com-                    addr, type,                                                                              mand.                                                              {R | R/W}                                                            CML filename                                                                             Configure Memory Load-load the memory configu-                                ration stored in filename.                                         CMR        Configure Memory Reset-reset configured memory                                to default initialization.                                         CMS filename                                                                             Configure Memory Save-save memory configura-                                  tion in filename.                                                  DISPLAY COMMANDS                                                              DB  start position!                                                                      Display Breakpoints-display breakpoint configura-                             tion as set by the breakpoint commands.                            DC  start position!                                                                      Display memory Configuration-display memory                                   configuration beginning with start position.                       DE         Display Expression-display expressions in display                             window.                                                            DF filename,                                                                             Display File-display text file starting at line number.             line number!                                                                 DM address Display Memory-display memory starting at ad-                                 dress.                                                             DS  start position!                                                                      Display Symbols-display all symbols or start at start                         position line number.                                              DT  start position!                                                                      Display Trace-display trace configuration as set by                           trace commands.                                                    DV         Display Version-clear display area and print banner.               EXPRESSION COMMANDS                                                           EA expr,  name!,                                                                         Expression Add-add expression with optional de-                     radix!, {B | W | D}                                                   scriptors.                                                         ED id number                                                                             Expression Delete-delete expression identified by                             id number.                                                         EF id number,                                                                            Expression Format-format expression as set by-                     {A | B | D | F |                                     numerical parameters.                                              H | O}                                                               EL filename                                                                              Expression Load-load expression from filename.                     EN id number,                                                                            Expression reName-change expression name to                        name       name.                                                              ES filename                                                                              Expression Save-save expression in filename.                       JOURNAL COMMANDS                                                              JC filename                                                                              Journal Capture-in Command mode, save in file-                                name line commands for batch execution.                            JE filename                                                                              Journal Execute-execute commands stored in file-                              name by JC command.                                                JS         Journal capture Stop-halt JC command execution.                    LOAD COMMANDS                                                                 LB filename                                                                              Load Breakpoint configuration-load from filename                              the breakpoint configuration.                                      LC filename                                                                              Load memory Configuration-load from filename the                              memory configuration.                                              LE filename                                                                              Load Expressions-load expressions from filename.                   LM filename                                                                              Load Memory dump-load filename into memory at                                 locations set by the corresponding SM command.                     LO filename                                                                              Load COFF file-load the COFF file named filename.                  LR filename                                                                              Load Register configuration-load the registers with                           the configuration stored in filename.                              LT filename                                                                              Load Trace Configuration-load in trace configura-                             tion stored in filename.                                           MEMORY COMMANDS                                                               MA address,                                                                              Memory Assemble-show source statement at ad-                       statement  dress. Also, input/assemble new statement.                         MF start address,                                                                        Memory Fill-fill memory from start address to end                  end address, value                                                                       address with value.                                                MM address, value                                                                        Memory Modify-change location address to value.                    OP SYSTEM, REGISTER/EXPRESSION COMMANDS                                       O          Escape to Operating System. (Emulator retained in                             memory.)                                                           Q          Quit emulation session. (Emulation session not re-                            tained in memory.)                                                 R register, value                                                                        Fill register with value (could be expression results).            SAVE COMMANDS                                                                 SB filename                                                                              Save Breakpoint configuration-save the breakpoint                             configuration in filename.                                         SC filename                                                                              Save memory Configuration-save the memory con-                                figuration in filename.                                            SE filename                                                                              Save Expressions-save the expression in filename.                  SM filename, start                                                                       Save Memory dump-save the memory dump from                         address, end address                                                                     start address to end address-save in filename.                     SR filename                                                                              Save Registers-save registers in filename.                         ST filename                                                                              Save Trace configuration-save trace configuration                             in filename                                                        TRACE COMMANDS                                                                T          Trace mode-enter mode; mnemonic's final letter                                and operand(s) defined action.                                     TB         Trace Bottom-display bottom of trace file.                         TD         Trace Display-halts collecting trace samples in a                             trace and closes file opened by TE command.                        TE filename,                                                                             Trace Enable-enables collecting of trace samples in                expression a trace as long as expression is nonzero, and opens                           filename as new file to collect samples.                           TF column number,                                                                        Trace Format-trace report to show results of ex-                   expression pression in format column specified by column                                 number (expression not needed for column 0).                       TL filename                                                                              Trace Load-load trace configuration saved in file-                            name.                                                              TP sample number                                                                         Trade Position-display trace beginning at sample                              number.                                                            TS filename                                                                              Trace Save configuration-save trace configuration                             in filename.                                                       TT         Trace Top-display at top to trace file.                            TU id number                                                                             Trace Unformatted-delete id number expression                                 from trace configuration.                                          TX         Trace eXecute-execute in format specified by oper-                            and (similar to operands for eXecute commands).                    EXECUTION COMMANDS                                                            X          eXecute mode-enter mode; mnemonic's final letter                              and operand(s) defined action.                                     XB         eXecute Benchmark-executes beginning at current                               PC value. Halts at first breakpoint; the number of                            clock cycles executed from start to a breakpoint dis-                         plays in the CLK register.                                         XC  cycle count!                                                                         eXecute Cycle-execute for cycle count (clock cy-                              cles).                                                             XD         eXecute Disconnect-puts the emulator in user run                              mode, thus, functionally disconnecting the emulator                           from the target system.                                            XG         eXecute Go-execute, beginning at present PC                                   value.                                                             XI  count! eXecute Instruction-execute one (default) or count                            instructions, beginning at present PC value or until                          breakpoint.                                                        XL  count! eXecute Loop-Monitors execution, counting the                                 number of times the PC value returns to the same                              value it was at execution start.                                   XO         eXecute cOnnect-functionally connects the emula-                              tor to the target system.                                          XR         eXecute Reset-reset TMS320C30 as if the pin RE-                               SET was asserted. The value at the reset vector ad-                           dress (0 × 000000) is placed in the PC.                      ______________________________________                                    

What is claimed is:
 1. An electronic device, comprising:a semiconductorchip and an integrated circuit fabricated thereon, the integratedcircuit having a boundary and having interior circuitry for running inresponse to opcodes; a chip package having terminals electricallyconnected to said integrated circuit on said chip, including at least afirst said terminal and a second said terminal electrically connected tosaid chip as scan control and test clock terminals respectively, and atleast a third one of said terminals electrically connected to said chipas an emulation control terminal; the interior circuitry including aCROM control read-only memory on-chip having entry points with at leastsome of the entry points controlled by opcode decodes, and functioncircuitry responsive to said CROM to execute opcodes and performfunctions of said integrated circuit; a scan interface on-chip includingat least a test access port controller state machine responsive to saidfirst terminal, and a first serial scan path associated with theboundary and coupled for clocking to said second terminal, and a secondserial scan path associated with said interior function circuitry; andsaid scan interface further having control circuitry coupled to respondto at least said third terminal and said scan interface having modesincluding at least a first mode of BIST built-in self test, a secondmode of emulation wherein said interior functional circuitry is coupledto said second scan path for at least single-stepping of opcodes, and athird mode wherein said function circuitry runs normally and decoupledfrom said second scan path.
 2. An electronic device, comprising:asemiconductor chip having fabricated thereon an integrated circuithaving a boundary and having interior functional circuitry for runningin response to instructions; a scan interface on-chip including a statemachine responsive to an external input, a first serial scan pathassociated with the boundary, and a second serial scan path associatedwith said interior functional circuitry; said scan interface furtherincluding control circuitry having modes including at least a first modeof BIST built-in self test, a second mode of emulation wherein saidinterior functional circuitry is coupled to said second scan path for atleast single-stepping of said instructions, and a third mode whereinsaid interior functional circuitry runs normally in response to saidinstructions and is decoupled from said second scan path.
 3. Theelectronic device claimed in claim 1 further comprising terminalscoupled to said scan interface for scan control, test clock, scan-in,and scan-out and at least one further terminal coupled to said controlcircuitry for emulation control.
 4. The electronic device claimed inclaim 1 further comprising terminals coupled to said scan interface forscan control, test clock, scan-in, and scan-out and at least two furtherterminals coupled to said control circuitry for emulation control. 5.The electronic device claimed in claim 1 further comprising terminalscoupled to said scan interface for scan control, test clock, scan-in,and scan-out and at least one further terminal for emulation controlinput and at least one further terminal for emulation control output. 6.The electronic device claimed in claim 1 further comprising terminalsfor scan control, test clock, scan-in, and scan-out and at least onefurther terminal for emulation control output.
 7. A method of operatingan integrated circuit having a boundary and having interior functionalcircuitry for running in response to instructions, and further providedwith a first serial scan path associated with the boundary and a secondserial scan path associated with said interior functional circuitry, andat least a first terminal and a second terminal electrically connectedto said integrated circuit as scan control and test clock terminalsrespectively, and at least a third terminal electrically connected tosaid chip as an emulation control terminal, said method comprising thesteps of:operating a scan interface on-chip in alternative modesresponsive to said scan control terminal and said emulation controlterminal, including:in a first mode, scan-testing the boundary via thefirst scan path; in a second mode, self-testing the interior functionalcircuitry according to a BIST built-in self test; in a third mode,coupling said interior functional circuitry to a second scan pathaccording to an emulation method including at least single-stepping ofinstructions; and in a fourth mode, decoupling the interior functionalcircuitry from said second scan path and running the interior functionalcircuitry normally.